ssl-tomcat6 http 能正常访问 https 报404错误

问题描述

tomcat6 http 能正常访问 https 报404错误
同url http能正常访问 https不能访问 报404错误
如:http://localhost/index.index 正常 https://localhost/index.html 为404
服务器环境:linux tomcat 6.0.36 jdk 1.6.0_37 64-Bit
本机模拟配置一切正常。推断可能服务器环境存在问题,求大神指出
server.xml
<?xml version='1.0' encoding='utf-8'?>

<!--APR library loader. Documentation at /docs/apr.html -->

<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->

<!-- Prevent memory leaks due to use of particular java/javax APIs-->

<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->

<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->

<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
type=""org.apache.catalina.UserDatabase""
description=""User database that can be updated and saved""
factory=""org.apache.catalina.users.MemoryUserDatabaseFactory""
pathname=""conf/tomcat-users.xml"" />

<!-- A ""Service"" is a collection of one or more ""Connectors"" that share
a single ""Container"" Note: A ""Service"" is not itself a ""Container""
so you may not define subcomponents such as ""Valves"" at this level.
Documentation at /docs/config/service.html
-->

<!--The connectors can use a shared executor you can define one or more named thread pools--><!--<Executor name=""tomcatThreadPool"" namePrefix=""catalina-exec-""     maxThreads=""150"" minSpareThreads=""4""/>--><!-- A ""Connector"" represents an endpoint by which requests are received     and responses are returned. Documentation at :     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)     Java AJP  Connector: /docs/config/ajp.html     APR (HTTP/AJP) Connector: /docs/apr.html     Define a non-SSL HTTP/1.1 Connector on port 8080--><Connector port=""80"" protocol=""HTTP/1.1""            connectionTimeout=""20000""            redirectPort=""8443"" /><Connector port=""443"" protocol=""org.apache.coyote.http11.Http11Protocol"" SSLEnabled=""true"" maxThreads=""150"" scheme=""https""

secure=""true"" clientAuth=""false"" sslProtocol=""TLS"" keystoreFile=""/home/cer/shcmctstore.jks""
keystorePass=""12345678"" truststoreFile=""/home/cer/shcmctkeystore.jks"" truststorePass=""12345678"" />

<!-- A ""Connector"" using the shared thread pool--><!--<Connector executor=""tomcatThreadPool""           port=""80"" protocol=""HTTP/1.1""            connectionTimeout=""20000""            redirectPort=""8443"" />-->           <!-- Define a SSL HTTP/1.1 Connector on port 8443     This connector uses the JSSE configuration when using APR the      connector should be using the OpenSSL style configuration     described in the APR documentation --><!--<Connector port=""8443"" protocol=""HTTP/1.1"" SSLEnabled=""true""           maxThreads=""150"" scheme=""https"" secure=""true""           clientAuth=""false"" sslProtocol=""TLS"" />--><!-- Define an AJP 1.3 Connector on port 8009 --><!-- <Connector port=""8009"" protocol=""AJP/1.3"" redirectPort=""8443"" />--><!-- An Engine represents the entry point (within Catalina) that processes     every request.  The Engine implementation for Tomcat stand alone     analyzes the HTTP headers included with the request and passes them     on to the appropriate Host (virtual host).     Documentation at /docs/config/engine.html --><!-- You should set jvmRoute to support load-balancing via AJP ie :<Engine name=""Catalina"" defaultHost=""localhost"" jvmRoute=""jvm1"">         --> <Engine name=""Catalina"" defaultHost=""localhost"">  <!--For clustering please take a look at documentation at:      /docs/cluster-howto.html  (simple how to)      /docs/config/cluster.html (reference documentation) -->  <!--  <Cluster className=""org.apache.catalina.ha.tcp.SimpleTcpCluster""/>  -->          <!-- The request dumper valve dumps useful debugging information about       the request and response data received and sent by Tomcat.       Documentation at: /docs/config/valve.html -->  <!--  <Valve className=""org.apache.catalina.valves.RequestDumperValve""/>  -->  <!-- This Realm uses the UserDatabase configured in the global JNDI       resources under the key ""UserDatabase"".  Any edits       that are performed against this UserDatabase are immediately       available for use by the Realm.  -->  <Realm className=""org.apache.catalina.realm.UserDatabaseRealm""         resourceName=""UserDatabase""/>  <!-- Define the default virtual host       Note: XML Schema validation will not work with Xerces 2.2.   -->  <Host name=""localhost""  appBase=""webapps""        unpackWARs=""true"" autoDeploy=""true""        xmlValidation=""false"" xmlNamespaceAware=""false"">    <!-- SingleSignOn valve share authentication between web applications         Documentation at: /docs/config/valve.html -->    <!--    <Valve className=""org.apache.catalina.authenticator.SingleSignOn"" />    -->    <!-- Access log processes all example.         Documentation at: /docs/config/valve.html -->    <!--    <Valve className=""org.apache.catalina.valves.AccessLogValve"" directory=""logs""             prefix=""localhost_access_log."" suffix="".txt"" pattern=""common"" resolveHosts=""false""/>    -->  </Host></Engine>

connectionTimeout=""20000""
redirectPort=""8443"" />

resourceName=""UserDatabase""/>
unpackWARs=""true"" autoDeploy=""true""
xmlValidation=""false"" xmlNamespaceAware=""false"">

tomcat启动log

Aug 14 2014 10:34:43 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_37/jre/lib/amd64/server:/usr/java/jdk1.6.0_37/jre/lib/amd64:/usr/java/jdk1.6.0_37/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Aug 14 2014 10:34:43 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Aug 14 2014 10:34:43 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-443
Aug 14 2014 10:34:43 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-12345
Aug 14 2014 10:34:43 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 591 ms
Aug 14 2014 10:34:43 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 14 2014 10:34:43 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
Aug 14 2014 10:34:43 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
INFO [main] 10:34:44364 (ContextLoader.java:189): -Root WebApplicationContext: initialization started
INFO [main] 10:34:44391 (AbstractApplicationContext.java:411): -Refreshing org.springframework.web.context.support.XmlWebApplicationContext@7c33788d: display name [Root WebApplicationContext]; startup date [Thu Aug 14 10:34:44 CST 2014]; root of context hierarchy
INFO [main] 10:34:44443 (XmlBeanDefinitionReader.java:323): -Loading XML bean definitions from class path resource [applicationContext.xml]
INFO [main] 10:34:44627 (AbstractApplicationContext.java:426): -Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@7c33788d]: org.springframework.beans.factory.support.DefaultListableBeanFactory@79024994
INFO [main] 10:34:44700 (DefaultListableBeanFactory.java:414): -Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@79024994: defining beans [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#0dataSourcetransactionManagersqlMapClientsqlMapClientTemplatebaseServiceinfoDaoinfoServiceindexcompanyNewsphoneNumberservicesbusinessNewspartyNewsaboutCompanypictureNewsbusinessHiretroubleshootingcompanyCermanagementCerhonorGMWordorgChartperformancenoticeemployeeNewsmanagerDaomanagerServicemanagerfileUploadviewContentappsOfComp]; root of factory hierarchy
INFO [main] 10:34:44894 (ContextLoader.java:209): -Root WebApplicationContext: initialization completed in 528 ms
INFO [main] 10:34:44996 (CommonsLogger.java:31): -Parsing configuration file [struts-default.xml]
INFO [main] 10:34:50728 (CommonsLogger.java:31): -Parsing configuration file [struts-plugin.xml]
INFO [main] 10:34:50741 (CommonsLogger.java:31): -Parsing configuration file [struts.xml]
INFO [main] 10:34:50797 (CommonsLogger.java:31): -Initializing Struts-Spring integration...
INFO [main] 10:34:50797 (CommonsLogger.java:31): -Setting autowire strategy to name
INFO [main] 10:34:50798 (CommonsLogger.java:31): -... initialized Struts-Spring integration successfully
Aug 14 2014 10:34:51 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Aug 14 2014 10:34:51 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-443
Aug 14 2014 10:34:51 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina1
Aug 14 2014 10:34:51 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
Aug 14 2014 10:34:51 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ota
Aug 14 2014 10:34:51 AM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'webapp.root' = [/usr/apache-tomcat-6.0.36/webapps1/ota/]
Aug 14 2014 10:34:51 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing log4j from [classpath:log4j.properties]
Aug 14 2014 10:34:51 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Aug 14 2014 10:34:54 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
Aug 14 2014 10:34:55 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-12345
Aug 14 2014 10:34:55 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 11514 ms

解决方案

这个是因为你的tomcat服务器还没有配置的原因吧!推荐看一下这篇文章http://wang153723482.blog.163.com/blog/static/1186498452012102162220245/

大体就是把server.xml文件中原有的这段配置改下
secure=""true"" clientAuth=""false"" sslProtocol=""TLS"" keystoreFile=""/home/cer/shcmctstore.jks""
keystorePass=""12345678"" truststoreFile=""/home/cer/shcmctkeystore.jks"" truststorePass=""12345678"" />

解决方案二:
请问楼主解决这个问题了吗?我也遇到同样的问题了,求解决方案

时间: 2025-01-29 22:43:59

ssl-tomcat6 http 能正常访问 https 报404错误的相关文章

我nignx 服务器 curl 地址https 报502错误是什么原因啊

问题描述 我nignx 服务器 curl 地址https 报502错误是什么原因啊 我nignx 服务器 curl 地址https 报502错误是什么原因啊 代码 $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 500); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl

求助: 布署项目到远程linux上的tomcat上.布署成功后,访问不到jsp,静态资源文件也访问不到. 报404错误.

问题描述 求助:布署项目到远程linux上的tomcat上.布署成功后,访问不到jsp,静态资源文件也访问不到.报404错误.20分钟前匿名|分类:JAVA相关|浏览3次求助:布署项目到远程linux上的tomcat上.布署成功后,访问不到jsp,静态资源文件也访问不到.报404错误.项目MVC层用的是struts2,在web.xml中配置的Struts2的.如果我将web.xml文件中的struts2的配置删除掉.这时就可以访问到静态的资源文件,也可以直接访问JSP文件了.但是这样STRUTS

服务器-struts2在web.xml中添加支持后访问所有页面报404错误,什么原因?

问题描述 struts2在web.xml中添加支持后访问所有页面报404错误,什么原因? struts2在web.xml中添加支持后访问所有页面报404错误,本地测试无任何问题,上传服务器就报所有页面404. web.xml struts.xml 运行后 解决方案 上传服务器之后,看看是不是请求IP,或者端口错了 解决方案二: 看看启动服务器报错没.估计你服务器在启动时就报错了 解决方案三: 看看服务器上jsp页面的路径对不对 解决方案四: 这情况一般是 启动服务器 然后就报错了... 找找看

wordpress后台访问时没有wp-admin报404错误原因分析

前几天不知道对wordpress所在的服务器做什么操作了今天更新时后台所有的菜单都出现了404错误.本来以为是服务器上丢失了文件导致的.但是我登录上服务器查看所有的后台文件都在呢.多点了几个链接发现URL里没有自动添加上wp-admin这一级目录,所以报404错误. 回想以下好像是我改了head的base,但是在代码里找了找没发现哪和之前不一样.和另一个wordpess的站的后台head对比了一下也没发现问题. 1. 检查网站 .htaccess 文件 登陆FTP找到根目录下的.htaccess

asp mvc 404 vs2013-ASP.Net MVC 报404错误

问题描述 ASP.Net MVC 报404错误 开发工具:VS2013 .net框架:4.5.1 之前还能访问一个控制器下的行为.现在报404错误. 请各位大神指点迷津啊!谢谢了啊! 解决方案 http://support.microsoft.com/kb/980368 你装下这个补丁.

spring mvc-初学spring,想做一个简单的登入验证功能,报404错误,已被困扰一天了,跪求帮助

问题描述 初学spring,想做一个简单的登入验证功能,报404错误,已被困扰一天了,跪求帮助 项目用ecliper ee开发,jdk1.7+mysql+tomcat环境.初学spring,想做一个简单的页面登入验证功能,报404错误,用了spring mvc,在Controller类里打了断点发现程序根本没有执行Controller类,检查了n遍配置文件感觉都是对的.这个bug已经困扰我一天多了,跪求帮助!! 页面错误信息 项目目录结构 web.xml 配置 applicationContex

spring mvc-SPRING MVC的注解报404错误!

问题描述 SPRING MVC的注解报404错误! @Controller @RequestMapping("/user") @SessionAttributes("username") public class UserAction { @RequestMapping(params="method=reg") public String reg(@ModelAttribute("username")String userna

web xml-Struts2+Tomcat报404错误

问题描述 Struts2+Tomcat报404错误 今天在学Struts2时,测试一下登陆验证功能,部署到Tomcat上出现404 就是在访问http://localhost:8080/Struts2Pro/login.jsp时,出现404 web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.s

启动项目报404错误,到底是为什么啊?

问题描述 启动项目报404错误,到底是为什么啊? 为什么我的项目一在浏览器中启动就报404错误呢?我在web.xml里指定了欢迎页面,也在项目中编写好了,可一启动项目就报404错误,该配的包我也加进去了,到底是为什么啊? 解决方案 Tomcat正常启动后,报404错误 解决方案二: 看启动页面路径是否正确 解决方案三: 重新建一个项目,把内容拷贝过去,可以试试 解决方案四: 404不是请求服务器失败状态吗 解决方案五: 我只是一个小小的网页,额...学平面的,我猜应该是路径出错了,你把路径改一下