Tomcat have a context file for each deployed web application under the conf/Catalina/localhost directory. It has the file with the same name as the web app like manager.xml or host-manager.xml. So, if the file is not present, you need to create a file conf/Catalina/localhost/manager.xml and specify the rule to allow remote hosts. Add the following content.
You also need to create an XML file for the host-manager web app to allow access for remote hosts. Add the following content.
After you create the XML files, you must restart the Apache server in order to read the new files. Now, when you access the manager or host-manager web app, you will be prompted for authentication.