简体   繁体   English

在openshift中的tomcat server.xml中定义上下文

[英]Define a context in tomcat server.xml in openshift

I want to define a context in my tomcat server on openshift cloud. 我想在openshift云上的tomcat服务器中定义上下文。 I have done it successfully in my local tomcat server but I don't know how to do it on openshift. 我已经在本地的Tomcat服务器中成功完成了此操作,但是我不知道如何在openshift上执行此操作。 I did it in local by adding : 我在本地添加了:

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

to my tomcat's server.xml file. 到我的tomcat的server.xml文件。 But in openshift I don't know how to define the docbase attribute. 但是在openshift中,我不知道如何定义docbase属性。 Thanks for any useful response! 感谢您提供任何有用的回复!

You shouldn't really be using <Context> in server.xml these days. 这些天,您实际上不应该在server.xml中使用<Context>

Instead, put your WAR file in the proper place. 而是将WAR文件放在适当的位置。 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. 如果必须使用XML描述符,请获取META-INF/context.xml文件( 应该具有!),并将其放入CATALINA_BASE/conf/[engine]/[host]/[appname].xml然后Tomcat会部署它。

Unfortunately, if you can't use WAR-deployment, then you'll still have to figure out what the docBase should be. 不幸的是,如果您不能使用WAR部署,那么您仍然必须弄清楚docBase应该是什么。 Where is your WAR file? 您的WAR文件在哪里?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM