Yair Harel

Greenhorn
+ Follow
since Aug 20, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yair Harel

Joseph Swager wrote:Hey Tim thank you so much for all your help. I solved it with a virtual server within server.xml file. When I get back into the office I'll show the exact setup i set for <Host> tags. It works like a charm.




Any chance you can collaborate how to solve this ??? I'm stuck on the same problem...

Thanks!!
Yair
12 years ago
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


12 years ago