0

I've installed Centos7 minimal, then Nginx to reverse proxy and manage SSL, then Tomcat 8.5.16 with a War app deployed.

Now my app runs from mywebapps.co.uk/mywebapp

I want to change the root folder so the app runs from mywebapps.co.uk

This is what I've tried:

I edited my server.xml to add another host so I have:

    <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" />

   </Host>

<Host name="mywebapps.co.uk" appBase="opt/tomcat/webapps/mywebapp"
        unpackWARs="true" autoDeploy="true">


    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="mywebapp_access_log" suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />

  </Host>

I then have a directory /conf/Catalina/mywebapp which I created a file called mywebapp.xml which contains:

<Context path="" docBase="/opt/tomcat/webapps/mywebapp" 
debug="0" reloadable="true">
</Context>

This is from a tutorial: http://www.flashguides.co.uk/guide/Configuring_Virtual_Hosts_in_Tomcat

currently no change to website can only access through mywebapps.co.uk/mywebapp

danbdex
  • 35
  • 1
  • 10

1 Answers1

0

I added :

*** Context path="" docBase="mywebbapp"/>

into the server.xml host section and it did the trick :)

Community
  • 1
  • 1
danbdex
  • 35
  • 1
  • 10