Skip to content

Commit 6aff919

Browse files
Update background service config docs
1 parent da86e7f commit 6aff919

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

docs/backgroundservice.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@ id: backgroundservice
33
title: Background Service
44
---
55

6-
In order to perform certificate requests and automatic renewals we install a background service called "Certify.Service" (Certify Certificate Manager Service). This service is installed to run as Local System and requires that the Local System account has the necessary privileges to administer IIS (if required) and the computers certificate store, as well as writing to the C:\ProgramData\Certify folder for configuration information. For more information on security and required permissions see [security](guides/security.md)
6+
In order to perform certificate requests and automatic renewals we install a background service called "Certify.Service" or "Certify.Server.Core" (the full title is either `Certify Certificate Manager Service` or `Certify Management Agent` for v7 onwards).
77

8-
To check the log for this service, review `C:\ProgramData\Certify\logs\service.exceptions.log`.
9-
10-
## Port 9696 is the default service port
8+
This service is installed to run as Local System and requires that the Local System account has the necessary privileges to administer IIS (if required) and the computers certificate store, as well as writing to the C:\ProgramData\Certify folder for configuration information. For more information on security and required permissions see [security](guides/security.md)
119

12-
By default the background service runs a local http API server on port 9696 for the UI to talk to (bound to local loopback 127.0.0.2 and requiring windows authentication). _Do not open this service to external traffic on your firewall._
10+
To check the log for this service, review `C:\ProgramData\Certify\logs\service.exceptions.log`.
1311

1412
## Custom configuration and Troubleshooting "..service not started" error
1513

16-
The background service operates a local API for the app on port `9696` by default. If this port is in use by another application/service (or for some other reason it cannot create a binding to `127.0.0.2:9696` (localhost), or a security product is preventing **local** port access) then you will see the message 'Service not started'.
14+
By default the background service runs a local http API server on port `9696` for the UI to talk to (bound to local loopback `127.0.0.2` and requiring windows authentication). _Do not open this service to external traffic on your firewall._
15+
16+
If this port is in use by another application/service or for some other reason the service cannot create/use a binding to `127.0.0.2:9696` (localhost), or a security product is preventing **local** port access) then you will see the message **'Service not started'**.
1717

18-
- `servers.json` : This is the connection information used by the UI to connect to the background service.
19-
- `serviceconfig.json` : These are the service settings and includes the host/ip and port the service will listen on, so it needs to match the details in `servers.json`.
2018

2119
:::info
2220
If you are repeatedly seeing the "Service Not Started" error, first try deleting `serviceconfig.json` and `servers.json` from C:\ProgramData\Certify\ then restart the background service and the app and these config files will be recreated. This can help if automatic port negotiation has gotten out of sync.
2321

2422
In some cases antivirus software products (such as *ClamWin*, *Watchguard Advanced EPDR*, *ESET*) have been known to prevent the Certify service installing properly or can prevent some core features working like our temporary http challenge service listener.
2523
:::
2624

27-
If the default port 9696 is already in use however you can manually specify the settings required by editing/adding the file `c:\programdata\certify\serviceconfig.json` (and servers.json) with content as per the following (adjusted as required) then restarting both the service and UI:
25+
- `servers.json` : This is the connection information used by the UI to connect to the background service.
26+
- `serviceconfig.json` : These are the service settings and includes the host/ip and port the service will listen on, so it needs to match the details in `servers.json`.
27+
28+
If the default port 9696 is already in use you can manually specify the settings required by editing/adding the file `c:\programdata\certify\serviceconfig.json` (and servers.json) with content as per the following (adjusted as required) then restarting both the service and UI:
2829

2930
```json
3031
{
@@ -43,7 +44,7 @@ For example an alternative configuration might be:
4344
}
4445
```
4546

46-
**You will also need to update corresponding configuration in the `servers.json` file (which the UI refers to in order to locate the service).**
47+
*You will also need to update corresponding configuration in the `servers.json` file (which the UI refers to in order to locate the service).*
4748

4849
To test that the reconfigured service is communicating OK, you can try opening the following URL in your browser:
4950
`http://localhost:9695/api/system/appversion` where 'localhost' is your configured service `host` value and `9695` is an example configured port.
@@ -54,17 +55,14 @@ You can also try the same using PowerShell:
5455
Invoke-RestMethod -Uri http://localhost:9696/api/system/appversion -UseDefaultCredentials
5556
```
5657

57-
## Other Considerations for 'Service Not Started..'
58+
### Other Considerations for 'Service Not Started..'
5859

5960
To operate properly the background service needs to be able to register an http listener for it's API server via http.sys, for that to work the IP address the service tries to use must be enabled as an http listen address and in some versions of windows the Http kernel service may not be enabled and you will need to enable it.
6061

61-
### Allow Local System account to bind an http listener to the service port
62-
63-
In some cases you need to explicitly allow the service to listen as an http service on the localhost IP address. To do so run the following command from the command line as an Administrator, substituting your choice of listening IP address and port:
6462

65-
`netsh http add urlacl url=http://127.0.0.2:9696/ user="NT AUTHORITY\SYSTEM"`
63+
#### Enable http listener IP address
6664

67-
### Enable http listener IP address
65+
**You do not normally have to configure any netsh iplisten rules, unless your system already has retrictions in place.**
6866

6967
If your system is restricting which IP addresses can listen for HTTP traffic you may find you need to enable iplisten for the service IP.
7068

@@ -86,6 +84,16 @@ netsh http add iplisten ipaddress=127.0.0.2
8684
```
8785
You should monitor other effects on other services when changing the IP listen configuration. We have seen one report of Exchange/Outlook slowing down when the 0.0.0.0 address iplisten is enabled.
8886

87+
:::info
88+
Check your current system IP listener rules using `netsh show iplisten`. If you have any IP listen rules *already configured* not using the catch-all `0.0.0.0` IP then your system will not listen on the default 127.0.0.2 IP and you will need to run `netsh http add iplisten ipaddress=127.0.0.2` to allow the service listener to work.
89+
:::
90+
91+
#### Allow Local System account to bind an http listener to the service port
92+
93+
In some cases you need to explicitly allow the service to listen as an http service on the localhost IP address. To do so run the following command from the command line as an Administrator, substituting your choice of listening IP address and port:
94+
95+
`netsh http add urlacl url=http://127.0.0.2:9696/ user="NT AUTHORITY\SYSTEM"`
96+
8997
By default the windows http service is typically enabled but if you receive the error 'Operation is not supported on this platform' in `service.exceptions.log` then try checking the status of the windows http service. To do so, run the following from an elevated command prompt (using Run As Administrator):
9098

9199
```bat

0 commit comments

Comments
 (0)