G
G
gnvs2021-05-25 15:48:20
Java
gnvs, 2021-05-25 15:48:20

How to point a domain to an Apache Tomcat application?

Good time,

I have several applications deployed, the path is:

1. /opt/tomcat/webapps/prilog1
2. /opt/tomcat/webapps/prilog2


Both applications are running at 127.0.0.1:8080/prilog1 and 127.0.0.1:8080/prilog2
get the form site1.ru and site2.ru .

Added entries for hosts in the Tomcat config in the server.xml file

<Host name="site1.ru"  appBase="prilog1" unpackWARs="true" autoDeploy="true">
        <Alias>site1.ru</Alias>
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
         prefix="project_access_log" suffix=".txt"
         pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>

<Host name="site2.ru"  appBase="prilog2" unpackWARs="true" autoDeploy="true">
        <Alias>site2.ru</Alias>
         <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
         prefix="project_access_log" suffix=".txt"
         pattern="%h %l %u %t &quot;%r&quot; %s %b" />
</Host>


I restart Tomcat, but it's no use.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-05-25
@xez

You also need to raise the http server.
For example: Nginx proxy for Apache Tomcat

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question