Installing Elasticsearch on a Remote Server
Information for Network Administrators
There are three sections to installing Elasticsearch on a remote server. These are steps usually completed by a network adminstrator.
- Installing prerequisites on the remote server.
- Installing the Elasticsearch service.
- Configuring the Elasticsearch web application.
-
Create and configure your web server on Internet Information Services (IIS).
Note: Ensure that ASP.NET 4.5 is installed on the web server.
-
Download and install .NET Core 1.1.6 Windows Hosting Bundle Installer.
See https://www.microsoft.com/net/download/dotnet-core/runtime-1.1.6.
- Reboot your web server.
- Download and install the 64-bit Java SE Development Kit (JDK) version 8 to your remote server.
- See http://www.madcapsoftware.com/downloads/jdk.aspx.
- When JDK 8 has been successfully installed, open the Environment Variables dialog on your server.
- Add a System Environment variable called “JAVA_HOME” that is pointing to the path where JDK was installed (i.e., C:\Program Files\Java\jdk1.8.0_171\).
- Double-click the Path system variable.
- Click New.
- Add the string '%JAVA_HOME%\bin'.
- Click OK.
- To verify that JDK 8 is working properly, open a command prompt window.
-
At the command prompt, type javac and click the Enter button. If you see javac options display below the command prompt, JDK 8 is working properly.
- Navigate to the Elasticsearch folder at the location where you have Flare installed (e.g., C:\Program Files\MadCap Software\MadCap Flare 14\Flare.app\Resources\Elasticsearch).
- Copy this Elasticsearch directory from your local machine to the remote server. The directory can be copied anywhere on the remote server.
- Open the elasticsearch.yml file in a text editor from the Elasticsearch\config directory you just copied over to the remote server.
- Find the string 'http.port: 9200' in this file. When you find it under the Network section, remove the # character from in front of the “http.port: 9200” string.
- Save your changes in this file.
- Open a command prompt window and navigate to the location of the copied Elasticsearch\bin directory.
- Type elasticsearch-service.bat install and click Enter.
- Type elasticsearch-service.bat start and click Enter. Elasticsearch is now running on your remote server.
- Copy the Web.ContentServices folder from your local machine where you have Flare installed (e.g., C:\Program Files\MadCap Software\MadCap Flare 14\Flare.app\Resources\WebHelp2\ContentServices\Web.ContentServices).
- Place this copy of the Web.ContentServices folder in the following location on the remote server: C:/inetpub/wwwroot.
- Create a folder titled “logs” within the Web.ContentServices folder on the remote server.
- Within the Web.ContentServices folder, open the appsettings.json file.
-
Under ConnectionStrings, update the path to be used for the DefaultConnection.
Note: Elasticsearch uses port 9200 by default. If you wish to change the port number, you can specify the port number in the DefaultConnection string (e.g., http://localhost: 9601). However, the port number must also match the http.port field in the elasticsearch.yml file.
-
Under ContentServicesStartupConfigSettings, update the path to be used for the DataRootDir.
Note: Ensure that the paths you provide for DefaultConnection and DataRootDir in the appsettings.json file have read/write permissions for the user account logging into the web server.
-
Install the URL Rewrite Module. This is necessary to enable IP address security restrictions to work in your web.config file.
- Within the Web.ContentServices folder, open the web.config file.
-
Remove the comment characters from the <rewrite> and </rewrite> tags in this file.
-
Modify YOUR_IP_ADDRESS with your desired IP address pattern . This restricts administrator access to your Content Services Portal for requests that originate only from IP addresses matching this pattern.
- Open IIS Manager.
-
Right-click Application Pools, and select Add Application Pool.
- In IIS Manager, navigate to Sites > Default Web Site.
-
Right-click Default Web Site and select Add Application.
- Enter the name of the Alias for your Elasticsearch website.
-
Click the Select button and choose your Application pool.
Note: You can use the default Application pool or create a new one for this service.
- Click the ellipsis button next to the Physical path field.
- Select the C:\inetpub\wwwroot\Web.ContentServices directory.
- Click OK. Your Content Services application is now displayed under Default Web Site in IIS.