我有 Amazon 自己的预打包实例,其中包含 Tomcat7 ( i-a23e4ac2 )。已将 war 文件上传到 webapps,在 Server.xml 中将连接器设置为侦听端口 80。
默认安全组设置为:
ALL sg-07787e6e (default)
TCP
Port (Service) Source Action
0 - 65535 sg-07787e6e (default)
80 (HTTP) 0.0.0.0/0
22 (SSH) 70.126.98.72/32
UDP
Port (Service) Source Action
0 - 65535 sg-07787e6e (default)
我有一个与该实例关联的弹性 IP。
... 但我无法获得任何积极的结果。
日志显示的内容如下:
stacktrace.log (in tomcat7 )
2011-10-02 13:40:11,840 stop children - Catalina:j2eeType=WebModule,name=//localhost/RemoteSupportWizard-0.1,J2EEApplication=none,J2EEServer=none ERROR StackTrace - Full Stack Trace:
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:172)
at org.springframework.context.support.AbstractApplicationContext.containsBean(AbstractApplicationContext.java:1109)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader$1.run(GrailsContextLoader.java:88)
at org.codehaus.groovy.grails.lifecycle.ShutdownOperations.runOperations(ShutdownOperations.java:62)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.closeWebApplicationContext(GrailsContextLoader.java:136)
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4763)
at org.apache.catalina.core.StandardContext$4.run(StandardContext.java:5473)
at java.lang.Thread.run(Thread.java:636)
2011-10-02 13:40:11,842 stop children - Catalina:j2eeType=WebModule,name=//localhost/RemoteSupportWizard-0.1,J2EEApplication=none,J2EEServer=none ERROR StackTrace - Full Stack Trace:
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at java.lang.Thread.run(Thread.java:636)
tail_catalina.log:
SEVERE: Failed to initialize end point associated with ProtocolHandler
java.net.BindException: Permission denied <null>:80
Browser:
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Apache/2.2.16 (Amazon) Server at 107.20.253.141 Port 80
如有任何建议,我们将不胜感激。
我应该尝试不同的实例吗?出于某种原因,我认为使用预先打包的实例会使部署变得容易得多。
答案1
仅允许 root 绑定低于 1024 的端口。以 root 身份运行 tomcat 或让其监听大于 1024 的端口。然后使用 iptables 防火墙规则将上部端口映射到端口 80。