{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":30572,"path":"it-operations-management/event-management/set-mid-web-server.md","title":"Set up the MID Web Server with a .pem file","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set up the MID Web Server with a .pem file\n\nInstall the .pem file into the MID unified keystore and set up the MID Web Server to enable configuring mTLS on your MID Web Server and agent.\n\n## Before you begin\n\nCopy the `labmid/mid.pem` file \\(created in the [Create keys and certificates](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/create-keys-and-certificates.md) procedure\\) to your MID Web Server host directory.\n\n**Note:** This procedure includes commands for both CentOS 7/Linux and Windows Server environments. Select the commands relevant for your host operating system. If working with another Linux distribution, adapt the commands as needed for your specific OS.\n\nRole required: agent\\_client\\_collector\\_admin\n\n## Procedure\n\n1.  In a Linux environment:\n\n    1.  Access the agent subdirectory under the MID Server's host directory.\n\n    2.  Import the .pem file into the MID unified keystore.\n\n        ```\n        bin/scripts/manage-certificates.sh -a midwss /<path>/mid.pem;\n        bin/scripts/manage-certificates.sh -l;\n        ```\n\n        Replace `<path>` with the directory where you copied the mid.pem file.\n\n        The relevant part of the output is: `\"defaultsecuritypairhandle,midwss\"`\n\n    3.  Validate your MID Server on the instance.\n\n    4.  Select the MID Server on the instance and select **Setup ACC listener**.\n\n        A new MID Web Server is created.\n\n    5.  Navigate to the newly created MID Web Server record \\(**ecc\\_agent\\_ext\\_context\\_webserver**\\) on the instance.\n\n    6.  Select the MID Web Server and set the Keystore certificate alias value to `midwss`.\n\n    7.  Select **Save**.\n\n    8.  Restart the MID Web Server.\n\n2.  In a Windows environment:\n\n    1.  Access the agent subdirectory under the MID Server's host directory.\n\n    2.  Import the .pem file into the MID unified keystore.\n\n        ```\n        bin\\scripts\\manage-certificates.bat -a midwss <path>\\mid.pem\n        bin\\scripts\\manage-certificates.bat -l\n        ```\n\n        Replace `<path>` with the directory where you copied the mid.pem file.\n\n        The relevant part of the output is: `\"defaultsecuritypairhandle,midwss\"`\n\n    3.  Validate your MID Server on the instance.\n\n    4.  Select the MID Server on the instance and select **Setup ACC listener**.\n\n        A new MID Web Server is created.\n\n    5.  Navigate to the newly created MID Web Server record \\(**ecc\\_agent\\_ext\\_context\\_webserver**\\) on the instance.\n\n    6.  Select the MID Web Server and set the Keystore certificate alias value to `midwss`.\n\n    7.  Select **Save**.\n\n    8.  Restart the MID Web Server's Windows service using one of the following methods:\n\n        -   Use the Services app on the Windows host.\n        -   Use the command line with the MID Server's configured service name:\n\n            ```\n            net stop AgentClientCollector\n            net start AgentClientCollector\n            ```\n\n\n## What to do next\n\n[Connect the agent to the MID Web Server using TLS](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/agent-mid-connect.md).\n\n"}}