Tomcat配置帮助:多个端口没有响应

Tek*_*kus 5 configuration tomcat ports railo

我的目标是让端口80和81监听并提供来自两个不同路径的内容.我正在寻找复制我以前使用IIS和在特定端口上创建网站的内容.

我获取了基本配置文件,并在Server标记(server.xml)中添加了以下行:

<Service name="stable">
    <Connector port="80" protocol="HTTP/1.1" />
    <Context docBase="C:\websites\test\stable\" />
  </Service>
  <Service name="release">
    <Connector port="81" protocol="HTTP/1.1" />
    <Context docBase="C:\websites\test\release\" />
  </Service>
Run Code Online (Sandbox Code Playgroud)

我正在提示我必须为我想要运行的每个端口(在主Server标记内)安装带有Connector和Context标记的Service标记.

我查看了我的日志,发现了以下内容:

16-Jan-2011 8:54:44 AM org.apache.catalina.connector.CoyoteAdapter service
SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
    at java.lang.Thread.run(Thread.java:619)
Run Code Online (Sandbox Code Playgroud)

我知道Context在更本地化的context.xml文件中工作得更好,但我不介意重新启动,直到我开始工作.或者它可能需要在那里(不是每个APress Pro Apache TomCat6).

此时,转到IP:80不会显示任何内容,没有文件,没有错误,只是一个空白页面.即使我尝试访问index.html(在适当的docBase中复制),我得到一个没有任何错误的空白屏幕.

编辑#2

我想我会发布我的文件以防有人有更多的时间在他们的手上,并希望了解他们.

这是我的server.xml文件:http: //pastebin.com/DAunTPTg

这是我现在得到的错误:http: //pastebin.com/mrrd0116

编辑#3

为了简单起见,我试图让端口80正确响应.

根据我的书:

使用DNS配置的此虚拟主机的名称.嵌套在引擎中的其中一个主机必须具有与该引擎的defaultHost属性匹配的名称.

为什么我会指示除localhost之外的任何东西(localhost1不会工作呢?)

这就是我现在所处的位置,仍然无法正常工作:

<Service name="Stable">
        <Connector 
            port="80" 
            protocol="HTTP/1.1"                
            connectionTimeout="20000" />

        <Engine name="Stable" defaultHost="localhost">
            <Host 
                name="localhost"  
                appBase="webapps">

                <Context docBase="C:\websites\test\stable" />               
            </Host>
        </Engine>
  </Service>
Run Code Online (Sandbox Code Playgroud)

我也遇到了新的错误:

18-Jan-2011 8:37:12 PM org.apache.catalina.startup.Catalina start SEVERE:Catalina.start:LifecycleException:Error initializaing:java.lang.NullPointerException at org.apache.catalina.core.StandardContext.start( StandardContext.java:4380)org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)org.apache.catalina.core.StandardHost.start(StandardHost.java:785)atg.apache.catalina .core.ContainerBase.start(ContainerBase.java:1045)org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)org.apache.catalina.core.StandardService.start(StandardService.java:519) )org.apache.catalina.core.StandardServer.start(StandardServer.java:710)at org.apache.catalina.startup.Catalina.start(Catalina.java:581)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) )在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.M ethod.invoke(Method.java:597)org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

18-Jan-2011 8:36:47 PM org.apache.catalina.mbeans.ServerLifecycleListener createMBeans SEVERE:createMBeans:org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:1086)中的Throwable java.lang.NullPointerException org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:504)位于org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans的org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:570) (ServerLifecycleListener.java:366)位于org.apache的org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:535)org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:498).位于org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:628)的catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:656)位于org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener).java:278)org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(ServerLifecycleListener.java:129)位于org.apache.catalina的org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119). core.tandardServer.start(StandardServer.java:703)atg.apache.catalina.startup.Catalina.start(Catalina.java:581)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.在org.apache.catalina.startup.Bootstrap的java.lang.reflect.Method.invoke(Method.java:597)的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)中调用(NativeMethodAccessorImpl.java:39) .start(Bootstrap.java:289)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

编辑#4

我在conf文件夹下添加了文件夹结构/ Stable/localhost.还添加了host-manager.xml和manager.xml.

仍然无法正常工作.

编辑#5

我想我得到了它,好吧,我正在为日志文件中的一些错误提供html和cfml页面.

<Service name="Stable">
        <Connector 
            port="80" 
            protocol="HTTP/1.1"                
            connectionTimeout="20000" />

        <Engine name="Stable" defaultHost="localhost">
            <Host 
                name="localhost"  
                appBase="C:\websites\test\stable\">

                <Context docBase="C:\websites\test\stable\" path="" />              
            </Host>
        </Engine>
  </Service>
Run Code Online (Sandbox Code Playgroud)

错误:

18-Jan-2011 11:31:40 PM org.apache.catalina.core.StandardContext resourcesStart SEVERE:启动静态时出错资源java.lang.IllegalArgumentException:文档库C:\ websites\test\stable\manager不存在或者是不是一个可读的目录»

Tek*_*kus 0

这对我有用:

<Service name="Stable">
    <Connector 
        port="80" 
        protocol="HTTP/1.1"                
        connectionTimeout="20000" />

    <Engine name="Stable" defaultHost="localhost">
        <Host 
            name="localhost"  
            appBase="C:\websites\test\stable\">

            <Context docBase="C:\websites\test\stable\" path="" />              
        </Host>
    </Engine>
Run Code Online (Sandbox Code Playgroud)