Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a apache tomcat server integrated with mod_jk. I have created .htaccess files in the directories I want to restrict. but the problem is .htaccess is working in apache served directories but not in the directories which is served by tomcat.

Apache document root is /var/ww/html I created a test directory under it and its working fine.

But in /usr/local/src/apache-tomcat-6.0.35/webapps/examples I created a .htaccess and its not working.

What could be the reason?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
579 views
Welcome To Ask or Share your Answers For Others

1 Answer

.htaccess are Apache Web Server files, not Tomcat. Tomcat just ignore these files. If you serve your application through mod_jk, then anything that JkMount maps to is served by Tomcat and no .htaccess will be processed. If you need to password protect Tomcat directories, you need to create a Realm in Tomcat and protect the web-resource. An old but I think still accurate example


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...