Hello,
I'm trying to configure virtual hosts on my tomcat 7 installation.
No matter what I did, tomcat route all the request to the "defaulthost" property which I defined in the server.xml file.
Here is the server.xml file, as you can see all the requests will be route to the "api" vhost.
<Engine name="Catalina" defaultHost="api">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="api" appBase="api"
unpackWARs="true" autoDeploy="true">
<Alias>api.tl.com</Alias>
<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="site"
unpackWARs="true" autoDeploy="true">
<Alias>tl.com</Alias>
<Alias>www.tl.com</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="author_log." suffix=".txt"
timestamp="true"/>
</Host>
<Host name="tl" appBase="tl"
unpackWARs="true" autoDeploy="true">
<Alias>tl.tl.com</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="author_log." suffix=".txt"
timestamp="true"/>
</Host>
<Host name="dev" appBase="dev"
unpackWARs="true" autoDeploy="true">
<Alias>dev.tl.com</Alias>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="author_log." suffix=".txt"
timestamp="true"/>
</Host>
</Engine>
I also define to each vhost the docBase directory, for example :
yair@ubuntu:~/tomcat$ cat conf/Catalina/site/ROOT.xml
<Context path="" docBase="/servers/yair/tomcat/site/ROOT" />
I'm using apache-tomcat-7.0.20 on ubuntu.
Appreciate any help !
Thanks,
Yair