2

I want to define a context in my tomcat server on openshift cloud. I have done it successfully in my local tomcat server but I don't know how to do it on openshift. I did it in local by adding :

<Context docBase="E:/captcha" path="/test/captcha"></Context>

to my tomcat's server.xml file. But in openshift I don't know how to define the docbase attribute. Thanks for any useful response!

hamid
  • 43
  • 7

1 Answers1

1

You shouldn't really be using <Context> in server.xml these days.

Instead, put your WAR file in the proper place. If you must use an XML descriptor, take the META-INF/context.xml file (which you should have!) and put it into CATALINA_BASE/conf/[engine]/[host]/[appname].xml and Tomcat will deploy it.

Unfortunately, if you can't use WAR-deployment, then you'll still have to figure out what the docBase should be. Where is your WAR file?

Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
  • I don't want o deploy a war file. I want to define a storage for my files in server.xml . and it should be addressed in openshift system. – hamid Jun 01 '14 at 15:55
  • Isn't the whole point of PaaS that you don't have to worry about the configuration of the application server? Just produce a WAR file and deploy? Anyhow, whether it's a WAR file or an exploded WAR directory (like `E:/captcha`), the point is the same: don't edit `conf/server.xml` and add `` elements. There are better ways to do it. – Christopher Schultz Jun 02 '14 at 21:33