Setting Up the Elasticsearch Server and Content Portal

Work through each section below to complete the remaining items needed for the Elasticsearch service.

How to Install the Elasticsearch Service

Install Elasticsearch on the remote server to provide the engine for the Elasticsearch service.

  1. From Windows File Explorer, right-click the Elasticsearch folder on the remote server, and select Properties.
  2. In the Elasticsearch Properties dialog, select the Security tab.
  3. In the Groups or user names section, select the Everyone account. If this account is not listed, do the following.
    1. Create this account by clicking Edit. (You need to be signed is as an administrator.)
    2. In the Permissions for Elasticsearch dialog, click Add. The Select Users, Computers, Service Accounts, or Groups dialog opens.
    3. In the Enter the object names to select section, type Everyone. Click OK.
  4. In the Permissions for Elasticsearch dialog, choose the permissions for Everyone. Under the Allow category, select Read and Write.
  5. Click OK.
  6. Navigate to Elasticsearch\config directory, and open the elasticsearch.yml file in a text editor (e.g., right-click, and select Edit with Notepad++).
  7. Under the Network section, find the string “http.port: 9200” and remove the # character from it.

    Note Elasticsearch uses port 9200 by default. You will notice in the Elasticsearch.yml file that the http port is 9200, and in the appsettings.json file the port is 9602 (in a later step). These numbers must match. You can choose to edit one of the files with either number. Just make sure they show the same number after the edits. If you change the port number in the YML file, you can specify the port number where it reads: http.port: 9200.

  8. Save the YML file.

  9. In the Windows Search bar, type cmd.

  10. In the command prompt, navigate to the location of the copied Elasticsearch\bin directory (e.g., cd C:\Elasticsearch\bin).

  11. Type elasticsearch-service.bat install and press ENTER.

  12. Type elasticsearch-service.bat start and press ENTER. Elasticsearch is now running as the remote web server.

How to Set Up the Content Services Portal

The Content Services Portal is necessary in order to manage the search data for the Elasticsearch-enabled HTML5 output.

  1. From Windows File Explorer, right-click the Web.ContentServices folder on the remote server, and select Properties.
  2. In the Web.ContentServices Properties dialog, select the Security tab.
  3. In the Groups or user names section, select the Everyone account. If this account is not listed, do the following.
    1. Create this account by clicking Edit. (You need to be signed is as an administrator.)
    2. In the Permissions for Web.ContentServices dialog, click Add. The Select Users, Computers, Service Accounts, or Groups dialog opens.
    3. In the Enter the object names to select section, type Everyone. Click OK.
  4. In the Permissions for Web.ContentServices dialog, choose the permissions for Everyone. Under the Allow category, select Read and Write.
  5. Click OK.
  6. In the Web.ContentServices folder on the remote server, create a folder titled "logs.”
  7. In the Web.ContentServices folder on the remote server, open the appsettings.json file in a text editor (e.g., right-click, and select Edit with Notepad++).
    1. Under the ConnectionStrings section, update the path to be used for the DefaultConnection. The default string line should read as shown in the following image.

      Note The Indices.db file is actually not created until the Content Services application is started in IIS and users start searching on the Elasticsearch output. In this step, you are simply specifying the location of where you want this file to reside on your remote server.

      Note Elasticsearch uses port 9200 by default. You will notice in the Elasticsearch.yml file that the http port is 9200 (in a previous step), and in the appsettings.json file the port is 9602. These numbers must match. You can choose to edit one of the files with either number. Just make sure they show the same number. If you change the port number in the JSON file, you can specify the port number where it reads: http://localhost: 9602.

    2. Under ContentServicesStartupConfigSettings, update the path to be used for the DataRootDir. The default string line should read as shown in the following image.

    3. Save the JSON file.

      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.

      Warning If you decide to place the Web.ContentServices folder in a different location from the C:\inetpub\wwwroot location, make sure the configuration settings in the appsettings.json file match the location on your remote server where you placed the Web.ContentServices folder.

Optional—How to Restrict Access to Content Services

To restrict access to the Content Services Portal, configure the Content Services web application. This is done by installing the URL Rewrite Module, which will enable IP address security restrictions to work in your web.config.file. This is an optional procedure.

  1. In a browser, navigate to:

    Copy
    https://www.iis.net/downloads/microsoft/url-rewrite
  2. From the URL Rewrite web page, scroll down to the Download URL Rewrite Module 2.1 section.
    1. Determine the appropriate download option for your machine (e.g., x64 installer), and select it.
    2. Click the executable file to install.
  3. In the Web.ContentServices folder on the remote server, open the web.config file in a text editor (e.g., right-click, and select Edit with Notepad++).
  4. Remove the comment characters from the <rewrite> and </rewrite> tags in this file.

  5. Modify YOUR_IP_ADDRESS with your desired IP address pattern. You can enter a range of IP addresses in this field, or a singular IP address. This will block other addresses that do not match your IP address pattern from gaining administrator access to your Content Services Portal.

    Note You can enter a single IP address of the remote server to limit portal access to users only on that computer. However, you might need to provide access for more than just the remote server computer. For example, enter a range of IP addresses to provide access for authors to publish to the server.

How to Configure the Content Services Web Application

  1. From the Windows Search bar, type IIS.
  2. Click the resulting item, Internet Information Services (IIS) Manager app to open IIS Manager.
  3. Right-click Application Pools, and select Add Application Pool. The Application Pool dialog opens.
  4. In the Name field, type a name (e.g., MyAppPool). Keep the other default settings, and click OK. For information about application pools, refer to Microsoft documentation:

    Copy
    https://docs.microsoft.com/en-us/iis/configuration/system.applicationhost/applicationpools/

  5. In the IIS Manager, navigate to Sites > Default Web Site.
  6. Right-click Default Web Site, and select Add Application.
  7. Enter the name of the Alias for your Elasticsearch website (e.g., MyPortal).
  8. 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.

  9. Next to the Physical path field, click the ellipsis button.
  10. Select the C:\inetpub\wwwroot\Web.ContentServices directory. Or, if you placed the Web.ContentServices directory in another location on your server, select that location instead.

  11. Click OK. Your Content Services application is now displayed under Default Web Site in IIS.

  12. Click Start (or Restart if it is already running) on your Default Web Site. The Content Services application is now running.

Optional—How to Verify Content Service Portal Installation

Verifying the installation of Content Services Portal is not necessary to do, but it might provide peace of mind that is running properly.

  1. From the Windows Search bar, type IIS.
  2. Click the resulting item, Internet Information Services (IIS) Manager app. The IIS Manager opens and should show the website configured from earlier steps.
  3. Right-click the portal (e.g. MyPortal) and select Manage Website > Browse. If the following page displays, the portal was configured successfully.

    The URL for the portal displays as http://localhost/MyPortal where “MyPortal” is the name of the website picked in an earlier step. In order for another computer to have access to this server, replace “localhost” with the name of the remote server. For example, the URL to use from another computer to access this portal is http://[name of server]/[MyPortal].

  4. Ensure the computer with Flare (used to publish to the server) has access to the remote server. Open a browser on that local computer and browse to http://[name of server]/[MyPortal]. It should display the same portal page as in the last step. This URL is the also the one to use for the Elasticsearch destination file in the Flare project.

What’s Next?

The next steps in the process involve integrating Elasticsearch with Flare. Once those are complete, you’ll be able take advantage of the full capabilities of Elasticsearch as your search engine. See Enabling Elasticsearch in the Target Editor.