0

I have Amazon's own prepackaged instance with Tomcat7 ( i-a23e4ac2 ). Got a war file uploaded to webapps, in Server.xml connector is set to listen on port 80.

Default security group settings are:

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)

I have an elastic ip associated with the instance.

... and I can't get any positive results with that.

Here's what logs are showing:

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

Any suggestions will be most appreciated.

Should I try a different instance? For some reason I thought using a prepackaged instance would make deployment a lot easier.

1 Answer 1

0

Only root is allowed to bind on ports lower than 1024. Either run tomcat as root or let it listen on a port >1024. Then use an iptables firewall rule to map the upper port to port 80.

4
  • 1
    I would consider it a bad practice to run Tomcat as root.
    – Corey S.
    Oct 2, 2011 at 14:50
  • @CoreyS. Me too. But it is a valid option.
    – mailq
    Oct 2, 2011 at 15:00
  • ... so what would be a better (proper) option? Port >1024 and ip tables? By the way, I din't have any luck running it on port 8080 either.
    – vector
    Oct 2, 2011 at 15:07
  • As I said: serverfault.com/questions/155275/…
    – mailq
    Oct 2, 2011 at 15:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .