Reputation: 1
I am running apache tomcat in a remote server, I have a domain with sub-domains. I want to assign each sub-domain with a separate project. I am unable to run apache on other domain except localhost. The domain is bind to the remote server IP Address so all sub-domains refers to all projects in webapps folder not one specific.
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
<Host name="https://web-dev.example.com/" appBase="web-dev.example.com"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
Upvotes: 0
Views: 588
Reputation: 16045
The name
attribute of your host should contain the DNS name of the virtual host:
Usually the network name of this virtual host, as registered in your Domain Name Service server. Regardless of the case used to specify the host name, Tomcat will convert it to lower case internally.
(cf. Tomcat documentation).
Therefore you should use:
<Host name="web-dev.example.com"
appBase="web-dev.example.com">
...
</Host>
(I omitted the attributes with default values).
Upvotes: 1