apache+tomcat+ssl问题

apache+tomcat+ssl问题

根据网上的说法配置成功了apache2.063+tomcat6,利用jk连接器,现在的问题是,ssl是应该加在apache配置文件,还是tomcat配置文件?我在网上找的文章是吧ssl加在了tomcat中,SERVER.xml如下:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="true" sslProtocol="TLS"
keystoreFile="d:\tomcat6\conf\mykeystore" keystorePass="123456"
truststorefile="C:\Program Files\Java\jdk1.5.0_06\jre\lib\security\cacerts" truststorepass="changeit"/>
web.xml如下:
<security-constraint>
      <display-name>Example Security Constraint </display-name>
    <user-data-constraint>
      <description>
        Constrain the user data transport for the whole application
      </description>
      <transport-guarantee>CONFIDENTIAL </transport-guarantee>
      </user-data-constraint>
      <web-resource-collection>
        <web-resource-name>Protected Area </web-resource-name>
<!-- Define the context-relative URL(s) to be protected -->
        <!-- <url-pattern>/jsp/security/protected/* </url-pattern> -->
<url-pattern>/* </url-pattern>
<!-- If you list http methods, only those methods are protected -->
<http-method>DELETE </http-method>
        <http-method>GET </http-method>
        <http-method>POST </http-method>
<http-method>PUT </http-method>
      </web-resource-collection>
      <!-- <auth-constraint>
          Anyone with one of the listed roles may access this area -->
<!--          <role-name>tomcat </role-name>
<role-name>role1 </role-name>
      </auth-constraint> -->
    </security-constraint>
urimap如下:
/* = ajp13
!/*.html = ajp13
!/*.htm = ajp13
!/*.jpg = ajp13
#!/*.gif = ajp13
!/*.css = ajp13
!/*.js = ajp13
!/*.php = ajp13
apache将请求全部交给tomcat处理,除了静态页,图片的一些请求,现在当访问http://localhost:8099/index.jsp时,会自动跳到https://localhost:8443/index.jsp,问题是当我在访问静态页时,tomcat怎么样将请求交给apache啊?我第一次配置服务器,也可能是我理解的不对,请高手帮帮忙,谢谢了!~~~  一直在线等
帮顶
可以加在apache下的ssl.conf中,下面是用ajp配的负载均衡
XML code
 
## ## SSL Virtual Host Context ## <VirtualHost _default_:443> # General setup for the virtual host, inherited from global configuration DocumentRoot /var/www/shtml DirectoryIndex test.htm <Directory /var/www/shtml> Options Indexes FollowSymLinks </Directory> ServerName www.test.com:443 ProxyRequests Off ProxyPass /test balancer://test/ stickysession=JSESSIONID <Proxy balancer://test/> #BalancerMember ajp://192.168.1.201:8009/test/ route=tomcat1 loadfactor=10 keepalive=On BalancerMember ajp://192.168.1.202:8009/test/ route=tomcat2 loadfactor=50 keepalive=On BalancerMember ajp://192.168.1.203:8009/test/ route=tomcat3 loadfactor=40 keepalive=On BalancerMember ajp://192.168.1.203:8020/test/ route=tomcat4 loadfactor=10 keepalive=On </Proxy> #ProxyPass /test ajp://localhost:8009/test #ProxyPassReverse /test ajp://localhost:8009/test 。。。。 </VirtualHost>
 

我的意思是说,由https://localhost:8443/index.jsp会正确显示,并实现了ssl,但我继续访问静态网页时候,例如https://localhost:8443/index.html,就会出现404错误,这是为什么~~~
不懂,帮顶
友情up
友情up
正在学这个,论坛里搜索了也没找到合适的答案,郁闷ING
你这样访问https://localhost:8443/index.html,其实就是直接访问tomcat的8443端口啊,出现404错误,是不是ROOT文件夹下或你配置的index.html根本不存在呢。
up