The default installation location for the Windows Gateway Service is c:\Program Files(x86)\Anypoint Gateway for Windows. This folder contains the Mule.SelfHost.exe executable and the Mule.SelfHost.exe.config configuration file.
|
|
If the configuration file doesn’t appear in the folder, in Windows 7, when the Control Panel View by option is set to Small icons, select Control Panel > Folder Options > View > Show hidden files, folders, and drives.
|
The executable starts a new web server at port 9333 (default), which only accepts secure connections using HTTPS. You can change the port number where the Gateway listens in the following places within the Mule.SelfHost.exe.config configuration file:
<appSettings>
<!-- Configure the service to listen on the following address. -->
<add key="OwinHostAddress" value="https://+:9333/"/>
...
</appSettings>
...
<system.serviceModel>
<services>
<service behaviorConfiguration="routing"
name="System.ServiceModel.Routing.RoutingService">
<host>
<baseAddresses>
<add baseAddress="https://*:9333/router"/>
</baseAddresses>
...
</system.serviceModel>
This web server uses a self-signed SSL certificate, which is auto-generated during installation. The certificate is in the Personal folder of the Local Computer certificate store:
Because the Windows service relies on http.sys for self-hosting the web server, changes in the port number or SSL certificate require reconfiguring Windows. The Register-SslCert.ps1 PowerShell script in the installation directory handles this task. If the port or certificate changes, run the following command from a PowerShell console:
Register-SslCert.ps1 <certificate-thumbprint> <windows-account> <port>
-
<certificate-thumbprint>: The thumbprint of the SSL certificate. It must be stored in the Personal Folder of the Local Store Account.
-
<windows-account>: Windows User or Group that receives permissions to register the port. The account impersonating the Windows service or console application must be part of this group.
-
<port>: HTTP port (9333 is the default) you set in the configuration file.
Register-SslCert.ps1 a495cbf8c4af496f1ef81efb224c8097d039f922 everyone 9333