htaccess的不工作的apache-tomcat的工作、htaccess、tomcat、apache

由网友(你贱的太过耀眼)分享简介:我有集成mod_jk的一个Apache Tomcat服务器。我已经在我要限制的目录中创建.htaccess文件。但问题是htaccess的是工作在Apache的服务目录,但不是在由服务tomcat的目录。 I have a apache tomcat server integrated with mod_jk. I...

我有集成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

阅读全文

相关推荐

最新文章