获得403(禁止)错误,而转发SSL请求从Apache服务器到Tomcat [英] Getting 403 (Forbidden) error while forwarding request of SSL from Apache server to Tomcat

查看:217
本文介绍了获得403(禁止)错误,而转发SSL请求从Apache服务器到Tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对我的CentOS使用Apache(httpd的),并部署在我的tomcat6的Java / Struts的Web应用程序。结果
我使用MOD_JK转发的Apache之间的请求到Tomcat。结果
如果要对SSL这项工作我也跟着<一个href=\"http://stackoverflow.com/questions/8402689/configure-apache-ssl-and-then-redirect-to-tomcat-with-mod-jk\">this stackflow问题来进行设置的httpd.conf,mod_jk.conf。结果
这是工作的罚款同一Web应用程序,当我使用HTTP的说法。结果
然而,通过HTTPS我得到403错误。当我看着日志,我发现下面的条目

I am using Apache (httpd) on my CentOS and deployed my Java/Struts web application on Tomcat6.
I am forwarding requests between Apache to Tomcat using Mod_JK.
To make this work on SSL I followed this stackflow question to make settings httpd.conf, mod_jk.conf.
This is working fine for same web application when I called it using HTTP.
However, through HTTPS I am getting 403 error. When I looked into the logs I found following entry

目录索引禁止通过选项指令:在/ var / lib中/ tomcat6中/ webapps /下的myapp /,引用者: https://开头我的域名IP

Directory index forbidden by Options directive: /var/lib/tomcat6/webapps/myapp/, referer: https://my domain IP

我试着在httpd.conf中设置目录如下图所示,但得到了同样的错误。

I tried setting Directory in httpd.conf like below but getting the same error

<Directory "/var/lib/tomcat6/webapps/<myapp>">
        Options +Indexes FollowSymLinks +ExecCGI
        AllowOverride AuthConfig FileInfo
        Order allow,deny
        Allow from all
</Directory>

请采取我没有作到Tomcat的server.xml任何更改尚未一张纸条。结果
任何帮助。

Please take a note that I haven't made any changes to Tomcat's Server.xml yet.
Any help.

编辑:结果
我创建虚拟的index.html,并保持它在我的应用程序的根文件夹。结果
然后我要求从网页浏览器相同的URL通过HTTPS,你猜怎么着?结果
我能看到我的index.html。然而,HTTP是工作在正确的方式。结果
现在,谁能告诉我怎样才能引导阿帕奇无法搜索任何的 index.html的但是tomcat的直接转发请求。


I created dummy index.html and kept it on my application root folder.
Then I requested the same URL from web browser through HTTPS, guess what?
I am able to see my index.html. However, HTTP is working in correct way.
Now can anyone tell me how can I guide apache not to search for any index.html but forward the request to tomcat directly.

修改-2:
当我试图改变目录选项为指标包括了FollowSymLinks ExecCGI,它开始显示目录列表。

Edit-2: When I tried changing Directory Options to "Indexes FollowSymLinks Includes ExecCGI", it started displaying directory lists.

推荐答案

的ssl.conf 文件$ P $中的 conf.d HTTPD 。你有没有看到那个文件呢?结果
这个文件(如果present)比什么是写在的httpd.conf 文件更高的优先级。结果
请看看你是否已经提供虚拟主机设置到文件或设置错误将写入该文件中。您也可以通过在的httpd.conf 文件注释你的virual主机present检查,并检查 403 错误依然在下。如果是这样的情况下,它是安静确保Apache是​​从其他文件中加载设置。如果 404 错误快到则可能是一些其他的东西来设置。

There is ssl.conf file present in conf.d folder of the HTTPD. Have you seen that file too?
This file (if present) has higher priority than what is written in httpd.conf file.
Please see if you have provided virtual host setting to that file or wrong settings are written in that file. You can also check by commenting your virual host present in httpd.conf file and check if the 403 error is still coming. If that is the case it is quiet sure that Apache is loading settings from some other file. If 404 error is coming then there might be some other things to set.

这篇关于获得403(禁止)错误,而转发SSL请求从Apache服务器到Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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