htaccess的不工作的apache-tomcat的 [英] .htaccess not working apache-tomcat

查看:389
本文介绍了htaccess的不工作的apache-tomcat的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有集成mod_jk的一个Apache Tomcat服务器。我已经在我要限制的目录中创建.htaccess文件。但问题是htaccess的是工作在Apache的服务目录,但不是在由服务tomcat的目录。

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的文档根目录为/ var / WW / HTML 我创建了下它和它的工作的罚款测试目录。

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

但在/usr/local/src/apache-tomcat-6.0.35/webapps/examples 我创建了一个htaccess的和它不工作。

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

可能是什么原因呢?

推荐答案

的.htaccess 是Apache网络服务器的文件,而不是Tomcat的。 Tomcat的只是忽略这些文件。如果您通过mod_jk的满足您的应用程序,那么任何的JkMount 映射到由服务Tomcat和没有的.htaccess将被处理。 如果您需要密码保护Tomcat的目录中,你需要创建一个Tomcat的境界,保护网络资源。 一个古老的,但我认为还是准确例如

.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

这篇关于htaccess的不工作的apache-tomcat的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆