Tomcat配置帮助:多个端口没有响应
我的目标是让端口80和81从两个不同的路径收听和提供内容。我正在考虑复制我以前使用IIS所做的工作,并在特定端口上创建网站 我获取了基本配置文件,并在服务器标记(Server.xml)中添加了以下行: 我知道在更本地化的Context.xml文件中,上下文工作得更好,但我不介意在它工作之前重新启动。或者它可能需要在那里(不是按照APress Pro Apache TomCat6) 此时,转到IP:80不会显示任何内容,没有文件,没有错误,只是一个空白页。即使当我尝试访问index.html(它被复制到适当的docBase中)时,我也会得到一个没有任何错误的空白屏幕 编辑#2 我想我应该把我的文件发出去,以防有人有更多的时间,想尝试一下 这是我的server.xml文件: 下面是我目前遇到的错误: 编辑#3 为了使事情更简单,我尝试让端口80正确响应 根据我的书: 此虚拟主机的名称,如所示 配置了DNS。其中一个 嵌套在引擎中的主机必须 具有与 该引擎的defaultHost属性 为什么我要指出localhost以外的任何东西(localhost1不起作用,是吗?) 这就是我现在的处境,仍然没有工作:Tomcat配置帮助:多个端口没有响应,tomcat,configuration,ports,railo,Tomcat,Configuration,Ports,Railo,我的目标是让端口80和81从两个不同的路径收听和提供内容。我正在考虑复制我以前使用IIS所做的工作,并在特定端口上创建网站 我获取了基本配置文件,并在服务器标记(Server.xml)中添加了以下行: 我知道在更本地化的Context.xml文件中,上下文工作得更好,但我不介意在它工作之前重新启动。或者它可能需要在那里(不是按照APress Pro Apache TomCat6) 此时,转到IP:80不会显示任何内容,没有文件,没有错误,只是一个空白页。即使当我尝试访问index.html(它被
<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>
我还发现了一个新的错误:
2011年1月18日下午8:37:12
org.apache.catalina.startup.catalina
严重启动:Catalina.start:
LifecycleException:错误
初始化:
位于的java.lang.NullPointerException
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)
在
org.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)
在
org.apache.catalina.startup.catalina.start(catalina.java:581)
在
sun.reflect.NativeMethodAccessorImpl.invoke0(本机
方法)在
invoke(NativeMethodAccessorImpl.java:39)
在
reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
在
java.lang.reflect.Method.invoke(Method.java:597)
在
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
在
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
及
2011年1月18日下午8:36:47
org.apache.catalina.mbeans.ServerLifecycleListener
createMBeans严重:createMBeans:
可抛出
位于的java.lang.NullPointerException
org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:1086)
在
org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:504)
在
org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:570)
在
org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:366)
在
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:656)
在
org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:628)
在
org.apache.catalina.mbeans.ServerLifecycleListener.createMBeans(ServerLifecycleListener.java:278)
在
org.apache.catalina.mbeans.ServerLifecycleListener.lifecycleEvent(ServerLifecycleListener.java:129)
在
org.apache.catalina.util.LifecycleSupport.FireLifecycleSupport(LifecycleSupport.java:119)
在
org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
在
org.apache.catalina.startup.catalina.start(catalina.java:581)
在
sun.reflect.NativeMethodAccessorImpl.invoke0(本机
方法)在
invoke(NativeMethodAccessorImpl.java:39)
在
reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
在
java.lang.reflect.Method.invoke(Method.java:597)
在
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
在
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>
错误:
2011年1月18日晚上11:31:40
org.apache.catalina.core.StandardContext
resourcesStart严重:启动时出错
静态资源
java.lang.IllegalArgumentException:
文档库
C:\websites\test\stable\manager
不存在或不可读
目录»
我认为您的思路是正确的,但是您缺少了服务元素规范中列出的一些子元素 我想您只是忘记了引擎和主机元素,它们分别是上下文元素的祖父母和父母
<Service name="stable">
<Connector port="80" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"/>
<Engine name="stable" defaultHost="localhost">
<Host name="localhost1" appBase="webapp1">
<Context docBase="C:\websites\test\stable\" />
</Host>
</Engine>
</Service>
<Service name="release">
<Connector port="81" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"/>
<Engine name="release" defaultHost="localhost2">
<Host name="localhost2" appBase="webapp2">
<Context docBase="C:\websites\test\release\" />
</Host>
</Engine>
</Service>
有关更多信息和更详细的
<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>
<Service name="stable">
<Connector port="80" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"/>
<Engine name="stable" defaultHost="localhost">
<Host name="localhost1" appBase="webapp1">
<Context docBase="C:\websites\test\stable\" />
</Host>
</Engine>
</Service>
<Service name="release">
<Connector port="81" protocol="HTTP/1.1"
maxThreads="150" connectionTimeout="20000"/>
<Engine name="release" defaultHost="localhost2">
<Host name="localhost2" appBase="webapp2">
<Context docBase="C:\websites\test\release\" />
</Host>
</Engine>
</Service>
<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>