Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:52:30+00:00 2026-06-08T18:52:30+00:00

I am having some issues when using mod_jk with Spring Security that has worked

  • 0

I am having some issues when using mod_jk with Spring Security that has worked on previous projects but I can’t seem to make it work now.

I’ve got a fairly typical situation using JBoss (but could as easily be Tomcat) when my web app is located at http://hostname/myapp and I want this to be hidden from the browser such that all accesses will be http://hostname

In Apache I’ve got a couple of rules :-

# Remove double "myapp" in url
RewriteRule ^/myapp/(.*) /$1

# Check to see if content can be served locally - rewrite back if not
RewriteCond /dir/to/static/content -f
RewriteRule ^/(.*) /myapp/$1 [PT]

JkMount /myapp/* loadbalancer

I’ve stripped back my Spring Security to be as simple as possible :

<security:http auto-config="true">
<security:intercept-url pattern="/**" access="ROLE_USER" />
</security:http>

In my web.xml

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
 </filter-mapping>

The issue is that without Spring security (ie. remove the springSecurityFilterChain) this works fine, but with it included I get issues like

Reason: Authentication method not supported: GET

when I try to log in.

My questions are :

  1. Is this a Spring Security issue needing configuration, or is my Apache not correct?
  2. Has anyone got a working config that they can share with me!

I’ve been struggling with this for several hours, reading lots of posts but I’ve not managed to get it working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:52:31+00:00Added an answer on June 8, 2026 at 6:52 pm

    To answer my own question to possibly help other people in the future. I had to switch to mod_proxy as opposed to mod_jk.

    My setup looks like this

    <Proxy>
       Order deny,allow
       Allow from all
    </Proxy>
    
    RewriteCond /dir/to/static/content/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*) ajp://127.0.0.1:8009/myapp/$1 [P]
    ProxyPassReverse /  http://myurl/myapp/
    ProxyPassReverseCookiePath /myapp /
    

    My spring security file

    <security:http auto-config="false" use-expressions="true" disable-url-rewriting="true">
       <security:intercept-url pattern="/app/login" access="permitAll" />
       <security:intercept-url pattern="/app/**" access="hasAnyRole('ROLE_USER', 'ROLE_ADMIN')" />
       <security:form-login
        login-page="/app/login"
        authentication-failure-url="/app/login?f=1"
        default-target-url="/app/map"/>
       <security:logout logout-url="/app/logout"/>
     </security:http>
    

    I think the key is the ProxyPassReverseCookiePath statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems simple enough but I'm having some issues, I tried using preg_replace: preg_replace(<br />,
I'm trying to implement autoloading in Php5.3 using namespaces but I'm having some issues
I'm having some issues returning unique results from a table that has some repeating
I'm having some issues with Jetty7 standalone and my spring web app using jsp/jstl/el.
Just having some issues with building a function using nodeJS. It doesn't seem to
I have installed FreeTDS on my Mac, but I'm having some issues connecting using
I'm trying to get Octopress (http://octopress.org/) working, but I'm having some issues. I'm using
I'm having some issues using mysqli to execute a script with SELECT,DELETE,INSERT and UPDATE
Hey I am having some issues while using Nggalley plugin for wordpress the plugin
I'm having some issues in doing a simple regex using sed. I've to do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.