Re: redirects https only for one app

2012-10-30 Thread Daniel Mikusa
On Oct 29, 2012, at 7:28 PM, Ted Smith wrote:

 Hello:
 
 I have several web apps (war files) under single host and webapps dir.
 I need to force HTTPS only for one of them and leave others unchanged.

My opinion is that the easiest fix would be to modify 
secure-app.war/WEB-INF/web.xml.

 config web.xml does not work as it applies to all apps.
 I feel there must be a way to config this using server config instead of 
 modifying
 a war file.

Couple other thoughts that might work for you…

1.) Use UrlRewriteFilter.  http://tuckey.org/urlrewrite/

2.) Write a custom valve.  
https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html

3.) Install Apache HTTPD on the same machine as Tomcat.  Set it up as a reverse 
proxy to Tomcat.  Configure HTTPD to handle HTTPS.

Dan


 
 Thanks in advance.
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: redirects https only for one app

2012-10-30 Thread Ted Smith

None of these alternatives is suitable for my situation.

I wonder since tomcat knows the contextname for each app,  if it is 
possible to have a context specific web.xml
in the conf file in addition to the one for all web.xml,   such as   
web_contextname.xml

that can be applied to contextname only.




On 10/30/2012 8:22 AM, Daniel Mikusa wrote:

On Oct 29, 2012, at 7:28 PM, Ted Smith wrote:


Hello:

I have several web apps (war files) under single host and webapps dir.
I need to force HTTPS only for one of them and leave others unchanged.

My opinion is that the easiest fix would be to modify 
secure-app.war/WEB-INF/web.xml.


config web.xml does not work as it applies to all apps.
I feel there must be a way to config this using server config instead of 
modifying
a war file.

Couple other thoughts that might work for you…

1.) Use UrlRewriteFilter.  http://tuckey.org/urlrewrite/

2.) Write a custom valve.  
https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html

3.) Install Apache HTTPD on the same machine as Tomcat.  Set it up as a reverse 
proxy to Tomcat.  Configure HTTPD to handle HTTPS.

Dan



Thanks in advance.





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: redirects https only for one app

2012-10-30 Thread Mark Thomas
On 30/10/2012 13:29, Ted Smith wrote:
 None of these alternatives is suitable for my situation.
 
 I wonder since tomcat knows the contextname for each app,  if it is
 possible to have a context specific web.xml
 in the conf file in addition to the one for all web.xml,   such as  
 web_contextname.xml
 that can be applied to contextname only.

There is an undocumented (apart from the JavaDoc) attribute for the
StandardContext [1] that you can use to specify an alternative
deployment descriptor. Look for altDDName. It needs to be the full path
to the alternative web.xml. I haven't tested this in a long time.

Mark

[1]
http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/core/StandardContext.html


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: redirects https only for one app

2012-10-30 Thread Pid
On 29/10/2012 23:28, Ted Smith wrote:
 Hello:
 
 I have several web apps (war files) under single host and webapps dir.

That's nice.
Tomcat version? Java version, OS ver... oh well.


 I need to force HTTPS only for one of them and leave others unchanged.
 config web.xml does not work as it applies to all apps.

What about the web.xml in each application?

You shouldn't be making changes to the tomcat/conf/web.xml file.


 I feel there must be a way to config this using server config instead of
 modifying a war file.

Why?  Servlet applications are supposed to be self-contained.


p


 Thanks in advance.
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: redirects https only for one app

2012-10-30 Thread Pid
On 30/10/2012 13:29, Ted Smith wrote:
 None of these alternatives is suitable for my situation.

Why?


p


 I wonder since tomcat knows the contextname for each app,  if it is
 possible to have a context specific web.xml
 in the conf file in addition to the one for all web.xml,   such as  
 web_contextname.xml
 that can be applied to contextname only.
 
 
 
 
 On 10/30/2012 8:22 AM, Daniel Mikusa wrote:
 On Oct 29, 2012, at 7:28 PM, Ted Smith wrote:

 Hello:

 I have several web apps (war files) under single host and webapps dir.
 I need to force HTTPS only for one of them and leave others unchanged.
 My opinion is that the easiest fix would be to modify
 secure-app.war/WEB-INF/web.xml.

 config web.xml does not work as it applies to all apps.
 I feel there must be a way to config this using server config instead
 of modifying
 a war file.
 Couple other thoughts that might work for you…

 1.) Use UrlRewriteFilter.  http://tuckey.org/urlrewrite/

 2.) Write a custom valve. 
 https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html

 3.) Install Apache HTTPD on the same machine as Tomcat.  Set it up as
 a reverse proxy to Tomcat.  Configure HTTPD to handle HTTPS.

 Dan


 Thanks in advance.





 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: redirects https only for one app

2012-10-30 Thread Ted Smith

It is a site specific scenario that those options can not be used.

Just feel having a app specific web.xml in conf dir would be reasoon,
context.xml allow specifying context/app name.

On 10/30/2012 3:45 PM, Pid wrote:

On 30/10/2012 13:29, Ted Smith wrote:

None of these alternatives is suitable for my situation.

Why?


p



I wonder since tomcat knows the contextname for each app,  if it is
possible to have a context specific web.xml
in the conf file in addition to the one for all web.xml,   such as
web_contextname.xml
that can be applied to contextname only.




On 10/30/2012 8:22 AM, Daniel Mikusa wrote:

On Oct 29, 2012, at 7:28 PM, Ted Smith wrote:


Hello:

I have several web apps (war files) under single host and webapps dir.
I need to force HTTPS only for one of them and leave others unchanged.

My opinion is that the easiest fix would be to modify
secure-app.war/WEB-INF/web.xml.


config web.xml does not work as it applies to all apps.
I feel there must be a way to config this using server config instead
of modifying
a war file.

Couple other thoughts that might work for you…

1.) Use UrlRewriteFilter.  http://tuckey.org/urlrewrite/

2.) Write a custom valve.
https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html

3.) Install Apache HTTPD on the same machine as Tomcat.  Set it up as
a reverse proxy to Tomcat.  Configure HTTPD to handle HTTPS.

Dan



Thanks in advance.





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: redirects https only for one app

2012-10-30 Thread Pid
On 30/10/2012 20:04, Ted Smith wrote:
 It is a site specific scenario that those options can not be used.

It is an entirely unexplained site specific scenario that you can't
modify a .war files configuration to get it to meet a site specific
requirement?

;)


 Just feel having a app specific web.xml in conf dir would be reasoon,
 context.xml allow specifying context/app name.

That's not the way the Servlet Spec works, have a read of it -  it's
actually mostly readable.

You can always extract the web.xml from the .war and update it, before
adding it back again.  A .war is a special type of .jar - so you can use
the JDK 'jar' command to operate on it.


p

 On 10/30/2012 3:45 PM, Pid wrote:
 On 30/10/2012 13:29, Ted Smith wrote:
 None of these alternatives is suitable for my situation.
 Why?


 p


 I wonder since tomcat knows the contextname for each app,  if it is
 possible to have a context specific web.xml
 in the conf file in addition to the one for all web.xml,   such as
 web_contextname.xml
 that can be applied to contextname only.




 On 10/30/2012 8:22 AM, Daniel Mikusa wrote:
 On Oct 29, 2012, at 7:28 PM, Ted Smith wrote:

 Hello:

 I have several web apps (war files) under single host and webapps dir.
 I need to force HTTPS only for one of them and leave others unchanged.
 My opinion is that the easiest fix would be to modify
 secure-app.war/WEB-INF/web.xml.

 config web.xml does not work as it applies to all apps.
 I feel there must be a way to config this using server config instead
 of modifying
 a war file.
 Couple other thoughts that might work for you…

 1.) Use UrlRewriteFilter.  http://tuckey.org/urlrewrite/

 2.) Write a custom valve.
 https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html

 3.) Install Apache HTTPD on the same machine as Tomcat.  Set it up as
 a reverse proxy to Tomcat.  Configure HTTPD to handle HTTPS.

 Dan


 Thanks in advance.





 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature