3

I want to use ant install to deploy (and re-deploy and re-deploy) my webapp on a local virtualhost.

It works fine with the default host, but the virtual host does not have the manager webapp. I would like to use similar setup in the live enviromnet (no manager on the given host).

I found a promisiong property:

webapp.virtual.host=...

in some example build.properties, but it does not seem to get the job done. Is it even possible, and how?

vbence
  • 20,084
  • 9
  • 69
  • 118

1 Answers1

2

In my answer to one SO post, Christian Semrau commented:

In standard configuration, Tomcat monitors its webapps folder and deploys any webapp for which you copy a .war file into the webapps folder, and undeploys it if you remove the .war file, and re-deploys it when you change the .war file. But when doing that, you don't get automatic feedback about the success of a deployment, which you do get from the Tomcat Manager.

That said, your task becomes as easy as copying or removing the file on the remote server.

Yet, I still don't understand why having manager app is a problem. You could, for example, only deploy it on different host/port:

<Connector port="8080" address="main.ip.add.ress">
  ...
  <Context path="/your_main_context">
  ...
  </Context>
</Connector>

<Connector port="18080" address="another.ip.add.ress">
  ...
  <Context path="/manager">
  ...
  </Context>
</Connector>

and put relevant firewall restrictions. Or, alternatively, you could place

<Valve className="org.apache.catalina.valves.RemoteHostValve"
     allow=".*\.mycompany\.com|www\.yourcompany\.com"/>      

inside Context and achieve similar results.

Community
  • 1
  • 1
mindas
  • 26,463
  • 15
  • 97
  • 154
  • "You could, for example, only deploy it on a certain IP/port" What do you mean by that? I want the manager app to be separated from the publicly accessible realm. That's why I currently use separate virtual hosts (but the root problem is that Manager App won't deploy cross-host). – vbence May 10 '11 at 19:06
  • Thanks for the example. I will award you the bounty after the lock time. Can you point me toards the docs describing this structure? (What attributes `Connector` and `Context` recognizes). – vbence May 10 '11 at 22:06
  • Thanks - have a look at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html and http://tomcat.apache.org/tomcat-6.0-doc/config/http.html (possibly, other items/links on the left menu) – mindas May 11 '11 at 08:58