Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to make a webapp running in a tomcat available under multiple contexts.

http://localhost:8080/foo

should also be available under

http://localhost:8080/bar

but I do not want to have a second web application (e.g. by duplicating the war file or symlinking)

Is there a way to create such an alias inside tomcat or do I have to use mod_rewrite in apache2? (I already use mod_jk)

share|improve this question

1 Answer 1

I never get such constructions working with links or duplicate the context configuration in tomcat. It produces internal errors in the webapp.

But you can use a ajp proxy in apache http configuration. This can provide the original context unter a new entry.

ProxyPass /original/ ajp://localhost:8010/original/
ProxyPass /test/ ajp://localhost:8010/original/

In my case unfortunately the webapps create links to the original context. So after some clicks the user step back to the original context again.

share|improve this answer
    
This solution would go around my mod_jk configuration and talk to the ajp port directly, am I right? In this case this is not suitable for me because I want to control which tomcat instance is used via the configuration of mod_jk load balancing in my workers.properties –  Thomas Einwaller Sep 18 '13 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.