Setting Up Coveo for Sitecore in a Remote Server Configuration
Setting Up Coveo for Sitecore in a Remote Server Configuration
On-Premises only
To reduce the load on the Sitecore server, you may want to install Coveo Enterprise Search (CES) on its own server. This has a few implications:
- You must make additional configuration so that the different modules that make up Coveo for Sitecore can communicate with each other.
- Since communications now occur between two different servers, they have to be secured.
The current procedure will show you how to accomplish this.
The Sitecore server refers to the server on which your first Content Management (CM) system is installed. For a procedure on how to install Content Delivery (CD) systems, see Coveo for Sitecore Scaling Guide.
Requirements
- You have installed CES on a remote server (see Installing Coveo Enterprise Search (CES) On-Premises).
- You have installed Coveo for Sitecore on the Sitecore server.
Step 1: Copy the SSL Certificate of the CES Server to the Sitecore Server
For Coveo for Sitecore to be able to communicate with the Coveo Search Service securely, you must copy the SSL certificate of the CES server (typically located at C:\CES7\Config\Certificates\cert-iis.p12
) to the Sitecore server.
It’s suggested that, in your Sitecore folder (usually located under C:\inetpub\wwwroot\<SITECORE_INSTANCE>
), you create a new folder called CES
and copy the certificate there.
Step 2: Modify the Coveo Search Provider Configuration File
You must configure certain things in the configuration files in order to have your Sitecore instance communicate with your CES instance.
- Open your
Coveo.SearchProvider.Custom.config
file. It’s located under<SITECORE_INSTANCE_ROOT>\Website\App_Config\Include
. - Under the
defaultIndexConfiguration
node, add aserverUrl
element, and set its value to the URL of the Sitecore instance (typicallyhttp://<INSTANCE_HOSTNAME>
). This allows the security provider on the remote server to communicate with the Sitecore instance, to resolve item permissions. - Under the
defaultIndexConfiguration
node, add asearchCertificatePath
element, and set its value to the path where you copied the SSL certificate in Step 1.
Step 3: Modify the Coveo REST Endpoint Configuration File
The Coveo REST endpoint allows queries to be performed from within Sitecore. Those queries are forwarded to the Coveo Search API service, which is responsible for running the actual query.
Follow the steps appropriate to your situation.
Your Search API Service Is Installed on the Same Machine as CES
In this scenario, you must configure the Coveo REST endpoint used by Sitecore to connect to the Search API over the network.
- Open the
Coveo.SearchProvider.Rest.Custom.config
file in a text editor. -
Make sure that the value of the
searchApiUri
element matches the location of the Coveo Search API service. The default value ishttp://localhost:8080
.To validate the URL of the Coveo Search API service, open a web browser and append
/rest/search
to the URL taken from the configuration file.For example, if you have the following value in the configuration file:
<searchApiUri>http://<REMOTE_CES_HOST_NAME>:8080</searchApiUri>
Then you must use the following URL of your test in a web browser:
http://<REMOTE_CES_HOST_NAME>:8080/rest/search
If Windows authentication is enabled, as it’s by default, the web page should prompt you for your credentials. After entering valid ones, the service should return a JSON response.
- Save any changes that you have made to the file.
Your Search API Service Is Installed on the Same Machine as Sitecore
In this scenario, you must configure the Coveo Search API service to connect to the CES server over the network.
-
Using a text editor, open the Search API
config.yml
file (typically located in theC:\Program Files\Coveo Search API 8
folder). -
Make sure that the value of the
server
>uri
property matches the URL of the CES server.To validate the URL of the CES server, open a browser and append
/7.0/CoveoSearchService?wsdl
to the URL taken from the configuration file.For example, if you have the following value in the configuration file:
server: uri: https://<REMOTE_CES_HOST_NAME>:52810
Then you must use this URL of your test in a web browser:
https://<REMOTE_CES_HOST_NAME>:52810/7.0/CoveoSearchService?wsdl
You might get a warning regarding untrusted certificates. Then you will get an XML document which represents the web service definition.
- Copy the certificate files named
cert-ca.pem
andcert-iis.p12
from the remote CES server to the host where the Coveo Search API service is running. On the CES server, the certificates should be located underC:\CES7\Config\Certificates
. - In the
config.yml
file:- Set the value of the
server
>serverCertificatePath
property to the location of thecert-ca.pem
file. - Set the value of the
server
>clientCertificatePath
property to the location of thecert-iis.p12
file. - Save the file.
- Set the value of the
- Restart the Search API service. In
C:\Program Files\Coveo Search API 8
, runStopService.bat
, and thenStartService.bat
. It’s important to restart the Coveo Search API service anytime you modify theconfig.yml
file to have them take effect.
Step 4: Allow Communication Between Both Machines
Now that you’ve configured your Sitecore instance to communicate with your CES server, you need to allow communication between both machines.
This is the list of default ports. These ports can be configured in the configuration files noted above. If you changed the default ports, make sure that you open the new ones as in the configuration files.
On the Sitecore Server
Open the following ports:
-
Port 5682: open this port if you installed the Coveo Search API on the same server as CES.
This port allows communication between the Coveo Search API and RabbitMQ, which is installed alongside CES.
-
Port 8080: open this port if you installed the Coveo Search API on the same server as CES.
This port is used to communicate with the Coveo Search API.
On the CES Server
Open the following ports:
-
Port 80: open this port if you selected an unsecured connection during your installation of Coveo for Sitecore.
This port allows CES to communicate with a non-secured Sitecore server
-
Port 443: open this port if you selected a secured connection during your installation of Coveo for Sitecore.
This port allows CES to communicate with a secured Sitecore server.
-
Port 5682: open this port if you installed the Coveo Search API on the same server as Sitecore.
This port allows communication between the Coveo Search API and RabbitMQ, which is installed alongside CES.
-
Port 52810: open this port if you installed the Coveo Search API on the same server as Sitecore.
This port allows CES to communicate with the Coveo Search API.
Step 5: Rename Your .config
Files
Now that you have made all the modifications needed to allow communication between your servers, you need to continue the installation process of Coveo for Sitecore (see Installing Coveo for Sitecore).
It’s possible that you were disconnected from your Sitecore instance, therefore closing the wizard. The last step required to activate Coveo for Sitecore is to remove .example
from the following files. They’re located under App_config\Include\Coveo
.
It’s possible that those files are already renamed to .config
. In this case, go to the next step.
-
Coveo.CloudPlatformClient.Custom.config.example
-
Coveo.SearchProvider.config.example
-
Coveo.SearchProvider.Custom.config.example
-
Coveo.SearchProvider.Rest.config.example
-
Coveo.SearchProvider.Rest.Custom.config.example
-
Coveo.UI.Controls.config.example
Step 6: Rebuild the Index
Now that everything is properly configured, you need to rebuild your indexes (see Coveo for Sitecore Indexing Guide).
To view the indexing progress, you can start the CES console on the remote server. For more information, see Using the CES Console.
Upon creating the Sitecore security provider, an initialization error might be displayed in the CES console, such as: The remote name couldn't be resolved: '<INSTANCE_HOSTNAME>'
.
If this issue occurs, open the CES Administration Tool, select Configuration > Security > Security Providers and click your Sitecore security provider. Ensure that the URL in the field Sitecore Server Url
field is reachable by the CES server (for example, by changing the URL of a static IP or modifying your Hosts
file) and click Apply Changes.
Then, rebuild your Sitecore index (see Coveo for Sitecore Indexing Guide).