免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: forrest.w
打印 上一主题 下一主题

[Web] [求助]配置Apache和Tomcat整合时为什么出现404错误? [复制链接]

论坛徽章:
0
11 [报告]
发表于 2006-04-06 15:27 |只看该作者
你把你你的那个work-properties贴出来看看!

论坛徽章:
0
12 [报告]
发表于 2006-04-06 15:33 |只看该作者

  1. [shm]
  2. file=D:\Logs\Tomcat/jk2.log
  3. size=1048576
  4. # Example socket channel, override port and host.
  5. [channel.socket:localhost:8009]
  6. port=8009
  7. host=localhost
  8. # define the worker
  9. [ajp13:localhost:8009]
  10. channel=channel.socket:localhost:8009
  11. # Uri mapping
  12. [uri:/*.jsp]
  13. [uri:/myweb/*.jsp]
  14. worker=ajp13:localhost:8009
  15. # define the worker
  16. [status:status]
  17. # Uri mapping
  18. [uri:/jkstatus/*]
  19. worker=status:status
复制代码


我在iis里面加上.jsp的应用程序后,现在访问.jsp是这样一个错误页面,访问html仍然正常,在8080端口访问.jsp和.html也正常。
错误如下:


  1. 无法显示网页
  2. 您正在查找的页当前不可用。 网站可能遇到支持问题,或者您需要 调整您的浏览器设置。

  3. --------------------------------------------------------------------------------

  4. 请尝试以下操作:

  5. 单击  刷新按钮,或稍后重试。

  6. 如果您已经在地址栏中输入该网页的地址, 请确认其拼写正确。

  7. 要检查您的网络连接,请单击工具菜单,然后单击 Internet 选项。在连接选项卡上,单击设置。 设置必须与您的局域网 (LAN) 管理员或 Internet 服务供应商 (ISP) 提供的一致。
  8. 查看您的 Internet 连接设置是否正确被检测。您可能设置让 Microsoft Windows 检查您的网站并自动发现网络连接设置(如果您的网络管理员已经启用此设置)。
  9. 单击工具菜单,然后单击Internet 选项。
  10. 在连接选项卡上,单击LAN 设置。
  11. 选择自动检测设置,然后单击确定。
  12. 某些站点要求 128-位的连接安全性。单击帮助菜单,然后单击关于 Internet Explorer 可以查看您所安装的安全强度。
  13. 如果您要访问某安全站点,请确保您的安全设置能够支持。请单击工具菜单,然后单击 Internet 选项。在“高级”选项卡上,滚动到“安全”部分,复选 SSL 2.0、SSL 3.0、TLS 1.0、PCT 1.0 设置。
  14. 单击上一步按钮,尝试其他链接。


  15. 找不到服务器或 DNS 错误
  16. Internet Explorer  


复制代码

论坛徽章:
0
13 [报告]
发表于 2006-04-06 15:46 |只看该作者
如果方便的话,你把你的server.xml在<Host name="">..</Host>以前的所有部分贴出来让我看看

论坛徽章:
0
14 [报告]
发表于 2006-04-06 15:57 |只看该作者
挺方便的,我只是在tomcat的server.xml里面建立了myweb这样一个虚拟目录,改了一下host的appbase,不知道有没有影响?可是我的8080端口访问起来没有问题@_@


  1.       <Host name="localhost" appBase="D:\wwwroot"
  2.        unpackWARs="true" autoDeploy="true"
  3.        xmlValidation="false" xmlNamespaceAware="false">

  4.         <Context path="" docBase="D:\wwwroot\" debug="0" reloadable="true" crossContext="true" />
  5.         <Context path="/myweb" docBase="D:\wwwroot\myweb" debug="0" reloadable="true" crossContext="true"> </Context>

  6.       </Host>
复制代码


谢谢帮忙^^

论坛徽章:
0
15 [报告]
发表于 2006-04-06 16:00 |只看该作者
还有这是注册表:

  1. Windows Registry Editor Version 5.00

  2. [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector]

  3. [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\2.0]
  4. "serverRoot"="\"C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\""
  5. "extensionUri"="/jakarta/isapi_redirector2.dll"
  6. "workersFile"="\"C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\conf\\workers2.properties\""
  7. "logLevel"="DEBUG"


复制代码

论坛徽章:
0
16 [报告]
发表于 2006-04-06 16:00 |只看该作者
你没有明白我的意思哟,兄弟,我是说从server.xml整个文件的最开头到<HOST>之间的那部分内容呀,

论坛徽章:
0
17 [报告]
发表于 2006-04-06 16:07 |只看该作者
晕菜~~~我看花眼了,以前的内容我还没有改^_^

这个注释好乱阿,我不敢随便删了全贴出来^^


  1. <Server port="8005" shutdown="SHUTDOWN">

  2.   <!-- Comment these entries out to disable JMX MBeans support used for the
  3.        administration web application -->
  4.   <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  5.   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  6.   <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  7.   <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>

  8.   <!-- Global JNDI resources -->
  9.   <GlobalNamingResources>

  10.     <!-- Test entry for demonstration purposes -->
  11.     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

  12.     <!-- Editable user database that can also be used by
  13.          UserDatabaseRealm to authenticate users -->
  14.     <Resource name="UserDatabase" auth="Container"
  15.               type="org.apache.catalina.UserDatabase"
  16.        description="User database that can be updated and saved"
  17.            factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
  18.           pathname="conf/tomcat-users.xml" />

  19.   </GlobalNamingResources>

  20.   <!-- A "Service" is a collection of one or more "Connectors" that share
  21.        a single "Container" (and therefore the web applications visible
  22.        within that Container).  Normally, that Container is an "Engine",
  23.        but this is not required.

  24.        Note:  A "Service" is not itself a "Container", so you may not
  25.        define subcomponents such as "Valves" or "Loggers" at this level.
  26.    -->

  27.   <!-- Define the Tomcat Stand-Alone Service -->
  28.   <Service name="Catalina">

  29.     <!-- A "Connector" represents an endpoint by which requests are received
  30.          and responses are returned.  Each Connector passes requests on to the
  31.          associated "Container" (normally an Engine) for processing.

  32.          By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
  33.          You can also enable an SSL HTTP/1.1 Connector on port 8443 by
  34.          following the instructions below and uncommenting the second Connector
  35.          entry.  SSL support requires the following steps (see the SSL Config
  36.          HOWTO in the Tomcat 5 documentation bundle for more detailed
  37.          instructions):
  38.          * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
  39.            later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
  40.          * Execute:
  41.              %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
  42.              $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
  43.            with a password value of "changeit" for both the certificate and
  44.            the keystore itself.

  45.          By default, DNS lookups are enabled when a web application calls
  46.          request.getRemoteHost().  This can have an adverse impact on
  47.          performance, so you can disable it by setting the
  48.          "enableLookups" attribute to "false".  When DNS lookups are disabled,
  49.          request.getRemoteHost() will return the String version of the
  50.          IP address of the remote client.
  51.     -->

  52.     <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
  53.     <Connector
  54. port="8080"               maxHttpHeaderSize="8192"
  55.                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  56.                enableLookups="false" redirectPort="8443" acceptCount="100"
  57.                connectionTimeout="20000" disableUploadTimeout="true" />
  58.     <!-- Note : To disable connection timeouts, set connectionTimeout value
  59.      to 0 -->
  60.        
  61.         <!-- Note : To use gzip compression you could set the following properties :
  62.        
  63.                            compression="on"
  64.                            compressionMinSize="2048"
  65.                            noCompressionUserAgents="gozilla, traviata"
  66.                            compressableMimeType="text/html,text/xml"
  67.         -->

  68.     <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
  69.     <!--
  70.     <Connector port="8443" maxHttpHeaderSize="8192"
  71.                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  72.                enableLookups="false" disableUploadTimeout="true"
  73.                acceptCount="100" scheme="https" secure="true"
  74.                clientAuth="false" sslProtocol="TLS" />
  75.     -->

  76.     <!-- Define an AJP 1.3 Connector on port 8009 -->
  77.     <Connector port="8009"
  78.                enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

  79.     <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
  80.     <!-- See proxy documentation for more information about using this. -->
  81.     <!--
  82.     <Connector port="8082"
  83.                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
  84.                enableLookups="false" acceptCount="100" connectionTimeout="20000"
  85.                proxyPort="80" disableUploadTimeout="true" />
  86.     -->

  87.     <!-- An Engine represents the entry point (within Catalina) that processes
  88.          every request.  The Engine implementation for Tomcat stand alone
  89.          analyzes the HTTP headers included with the request, and passes them
  90.          on to the appropriate Host (virtual host). -->

  91.     <!-- You should set jvmRoute to support load-balancing via AJP ie :
  92.     <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
  93.     -->
  94.          
  95.     <!-- Define the top level container in our container hierarchy -->
  96.     <Engine name="Catalina" defaultHost="localhost">

  97.       <!-- The request dumper valve dumps useful debugging information about
  98.            the request headers and cookies that were received, and the response
  99.            headers and cookies that were sent, for all requests received by
  100.            this instance of Tomcat.  If you care only about requests to a
  101.            particular virtual host, or a particular application, nest this
  102.            element inside the corresponding <Host> or <Context> entry instead.

  103.            For a similar mechanism that is portable to all Servlet 2.4
  104.            containers, check out the "RequestDumperFilter" Filter in the
  105.            example application (the source for this filter may be found in
  106.            "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").

  107.            Request dumping is disabled by default.  Uncomment the following
  108.            element to enable it. -->
  109.       <!--
  110.       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
  111.       -->

  112.       <!-- Because this Realm is here, an instance will be shared globally -->

  113.       <!-- This Realm uses the UserDatabase configured in the global JNDI
  114.            resources under the key "UserDatabase".  Any edits
  115.            that are performed against this UserDatabase are immediately
  116.            available for use by the Realm.  -->
  117.       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
  118.              resourceName="UserDatabase"/>

  119.       <!-- Comment out the old realm but leave here for now in case we
  120.            need to go back quickly -->
  121.       <!--
  122.       <Realm className="org.apache.catalina.realm.MemoryRealm" />
  123.       -->
复制代码

论坛徽章:
0
18 [报告]
发表于 2006-04-06 16:19 |只看该作者
<!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
    -->
就说要启用这一行,同时,把jvm1改成你在work.propeties里设置的ajp13,同时
注释掉下面的那个<Engine name="catanila">...

论坛徽章:
0
19 [报告]
发表于 2006-04-06 16:22 |只看该作者
可是这个好像是负载均衡的?不管怎么着了,先试试再说

论坛徽章:
0
20 [报告]
发表于 2006-04-06 16:29 |只看该作者
仍然不能访问不加8080端口的页面,我的那个connector好像不起作用?搞不懂IIS6...
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP