(E-Mail Removed) said:
>Thank you, you got me pointed in the right direction and I figured it
>out fairly quickly! I now have Apache communicating ONLY thru jk2, the
>8080 and 8443 ports are now closed.
Good!
>I only have one more small problem:
>
>http://www.mydomain.com/servlets/myservlet and
>https://www.mydomain.com/servlets/myservlet
>
>both work. I need to force certain servlets to use SSL, ie the http://
>request should return some type of error, or maybe redirect them to the
>https:// URL.. I dont care if ALL servlets are forced to run over SSL,
>or if I need to specify each one separately. Thanx again,
If you don't want to provide anything from your server through
plaintext HTTP, just disable the non-SSL HTTP at Apache level.
Then to more fine-grained security: You can configure Tomcat
to require use of SSL for some resources, by configuring the
web.xml of your application. Here, I pretty much copy from
http://www.jguru.com/faq/view.jsp?EID=1082914 , but I'm
trying to expand on that a little bit.
The basic element for configuring URL security requirements in
web.xml is the <security-constraint> block; example:
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
The above will require use of SSL throughout the application.
You can have multiple <security-constraint> blocks within your
application (though I didn't read enough to find out how conflicts
are handled). Each <security-constraint> must contain one or more
<web-resource-collection>s, containing one or more <url-pattern>s
each. There can be zero or one <user-data-constraint>s, containing
exactly one <transport-guarantee> block. Allowed data within
<transport-guarantee> is one of NONE, INTEGRAL, or CONFIDENTIAL
(where INTEGRAL doesn't make much sense).
For reference on web.xml, see the Java servlet specification at
http://jcp.org/aboutJava/communitypr...154/index.html
Among others, this'll tell the correct order of elements in
web.xml -- the diagrams starting at chapter SRV.13.4 are just
wonderful.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)