# Configuring an application

This section guides you through the process of configuring the deployment to run your application.

1. Start the EAC on each server in the deployment environment. If this is a UNIX deployment, use the $ENDECA_ROOT/tools/server/bin/startup.sh shell script to start the EAC with the configuration files specified in your `$Endeca_CONF` directory. If this is a Windows deployment, ensure the Endeca HTTP Service is running, as it is the parent service that contains the EAC. The files in the workspace directory specify the settings for the EAC, including the port of the EAC Central Server and the EAC Agent server ports (on all servers, including the primary server) and SSL settings for the EAC.

   If the application is intended to integrate with Oracle Endeca Workbench, ensure that the Workbench is running.

2. Edit the AppConfig.xml file in [appdir]/config/script to reflect the details of your environment. Specifically:
   - Ensure that the `eacHost` and `eacPort` attributes of the app element specify the correct host and port of the EAC Central Server.
   - Ensure that the `host` elements specify the correct host name or names and EAC ports of all EAC Agents in your environment.
   - Ensure that the `ConfigManager` component specifies the correct host and port for Oracle Endeca Workbench, or that Workbench integration is disabled.

   In addition to checking the host and port settings, you should configure components (for example, add or remove Dgraphs to specify an appropriate Dgraph cluster for your application), adjust process flags if necessary, and select appropriate ports for each Dgraph and Logserver.

3. Run the initialize_services script to initialize each server in the deployment environment with the directories and configuration required to host your application. This script removes any existing provisioning associated with this application in the EAC and then adds the hosts and components in your provisioning document to the EAC, creating the directory structure used by these components on all servers. In addition, if Workbench integration is enabled, this script initializes Oracle Endeca Workbench by uploading the application's configuration files.
   - On Windows:

         [appdir]\control\initialize_services.bat

   - On UNIX:

         [appdir]/control/initialize_services.sh

   Use caution when running this script. The script forces any components that are defined for this application to stop, which may lead to service interruption if executed on a live environment. The script also removes any current Workbench configuration and removes any rules not maintained in [appdir]/config/pipeline.
4. Upload forge_input configuration to the primary server. Replace the sample wine configuration files in [appdir]/config/pipeline with the configuration files created in Developer Studio for your application. For details about inserting your custom project pipeline into the Deployment Template, refer to the section Inserting a Custom Pipeline.
5. If necessary, upload new source data to the primary server.

   Replace the sample wine data (wine_data.txt.gz ) in [appdir]/test_data/baseline with the data used by your application. Similarly, replace the partial update data in [appdir]/test_data/partial with your application's partial data.

   This step is not necessary if your application does not use data extracts (for example, if your application retrieves data directly from a database via ODBC or JDBC or from a CAS crawl). If this is the case, remove the `wine_data.txt.gz` file from [appdir]/test_data/baseline.

If no script customization is required, the application is now ready for use. During development, use the load_baseline_test_data script to simulate the data extraction process (or data readiness signal, in the case of an application that uses a non-extract data source). This script delivers the data extract in [appdir]/test_data/baseline and runs the set_baseline_data_ready_flag script, which sets a flag in the EAC indicating that data has been extracted and is ready for baseline update processing. In production, this step should be replaced with a data extraction process that delivers extracts into the incoming directory and sets the "`baseline_data_ready`" flag in the EAC. This flag can be set by making a Web service call to the EAC or by running the provided set_baseline_data_ready_flag script.

Related concepts
Integrating and running CAS crawls that write to Record Store instances
Integrating and running CAS crawls that write to record output files