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?

6
  • In <Host add different docBase to the specific app Feb 12, 2023 at 12:24
  • can you give an example for that? Feb 12, 2023 at 12:27
  • I add to the tag Host: <Context path="" docBase="ROOT" debug="0" reloadable="true"/> , and still got the same problem. Feb 12, 2023 at 12:46
  • No, docBase should point to the directory where the different app is deployed. Check this answer: stackoverflow.com/a/54366546/2908599 Feb 12, 2023 at 12:47
  • 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 domain1:8080 instead of only domain1) Feb 12, 2023 at 13:32

0

You must log in to answer this question.

Browse other questions tagged .