Setting Up Coveo for Sitecore in a Remote Server Configuration
Setting Up Coveo for Sitecore in a Remote Server Configuration
- Requirements
- Step 1: Copy the SSL Certificate of the CES Server to the Sitecore Server
- Step 2: Modify the Coveo Search Provider Configuration File
- Step 3: Modify the Coveo REST Endpoint Configuration File
- Step 4: Allow Communication Between Both Machines
- Step 5: Rename Your
.configFiles - Step 6: Rebuild the Index
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.
|
|
Note
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.configfile. It’s located under<SITECORE_INSTANCE_ROOT>\Website\App_Config\Include. -
Under the
defaultIndexConfigurationnode, add aserverUrlelement, 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
defaultIndexConfigurationnode, add asearchCertificatePathelement, 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.configfile in a text editor. -
Make sure that the value of the
searchApiUrielement matches the location of the Coveo Search API service. The default value ishttp://localhost:8080.NoteTo validate the URL of the Coveo Search API service, open a web browser and append
/rest/searchto 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/searchIf 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.ymlfile (typically located in theC:\Program Files\Coveo Search API 8folder). -
Make sure that the value of the
server>uriproperty matches the URL of the CES server.NoteTo validate the URL of the CES server, open a browser and append
/7.0/CoveoSearchService?wsdlto 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>:52810Then you must use this URL of your test in a web browser:
https://<REMOTE_CES_HOST_NAME>:52810/7.0/CoveoSearchService?wsdlYou 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.pemandcert-iis.p12from 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.ymlfile:-
Set the value of the
server>serverCertificatePathproperty to the location of thecert-ca.pemfile. -
Set the value of the
server>clientCertificatePathproperty to the location of thecert-iis.p12file. -
Save the file.
-
-
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.ymlfile 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.
|
|
Note
It’s possible that those files are already renamed to |
-
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).
|
|
Note
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: 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 Then, rebuild your Sitecore index (see Coveo for Sitecore Indexing Guide). |