0

I follow the instructions from here and this to my server.xml file for each domain/webapp:

<Host name="domain1.com" autoDeploy="true" appBase="webapps_domain1" unpackWARs="true">
     <Alias>www.domain1.com</Alias>
     <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"   
               prefix="localhost_access_log." suffix=".txt" 
               pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>
</Host>

and restart the tomcat, but I cannot access the webapp using the domain after that. I also create the directory webapp_domain1 in /var/lib/tomcat9 and copy a war file to it with the name ROOT.war (also for each domain/webapp).

Anyone can tell me what I am missing here?

Kleber Mota
  • 93
  • 1
  • 7
  • can you give an example for that? – Kleber Mota Feb 12 '23 at 12:27
  • I add to the tag `Host`: ` `, and still got the same problem. – Kleber Mota Feb 12 '23 at 12:46
  • No, docBase should point to the directory where the different app is deployed. Check this answer: https://stackoverflow.com/a/54366546/2908599 – Romeo Ninov Feb 12 '23 at 12:47
  • After follow the instructions in the answer, I have this in my `server.xml` file: https://pastebin.com/GGjSQqCH. And I have created a `ROOT.xml` file in the directory `conf/` for each domain with this content: `Context docBase="/var/lib/tomcat9/webapps_loja/ROOT.war" path="">`. But the problem continues. – Kleber Mota Feb 12 '23 at 13:16
  • 1
    nevermind, I just solve the problem now. I had to change the port for tomcat from 8080 to 80 (I figure out this when I notice I could access the webapp with http://domain1:8080 instead of only http://domain1) – Kleber Mota Feb 12 '23 at 13:32

0 Answers0