Reputation: 11
I'm attempting to deploy a Tomcat web application to an environment on AWS EB and when I do so everything goes smoothly until I try to view the page which times out with a notification that the site cannot be reached.
When deploying to Tomcat on localhost everything works perfectly and I'm using the same war file to deploy on AWS. Both use Tomcat 8.0 The structure of the war file is:
-CarbonCost.war
-WEB-INF
-lib
-classes
-Controller
-Controller.class
-Connect.class
-web.xml
-META-INF
-js
-img
-css
-index.jsp
-page2.jsp
The catalina.log file from AWS:
22-Nov-2017 18:03:49.754 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
22-Nov-2017 18:03:50.045 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
22-Nov-2017 18:03:50.095 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
22-Nov-2017 18:03:50.108 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
22-Nov-2017 18:03:50.119 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
22-Nov-2017 18:03:50.124 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 11657 ms
22-Nov-2017 18:03:50.220 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
22-Nov-2017 18:03:50.220 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.45
22-Nov-2017 18:03:50.260 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /var/lib/tomcat8/webapps/ROOT
22-Nov-2017 18:03:52.321 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
22-Nov-2017 18:03:52.431 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /var/lib/tomcat8/webapps/ROOT has finished in 2,170 ms
22-Nov-2017 18:03:52.443 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
22-Nov-2017 18:03:52.490 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
22-Nov-2017 18:03:52.513 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 2388 ms
I realise this may not be enough information to go on but I'm totally lost on how to proceed so any general guidance would be fantastic.
Thanks
Upvotes: 0
Views: 1203
Reputation: 256
Sorry, would comment on your answer but my rep is not currently high enough. Your configuration looks correct and this is a healthy startup log. The last line, Server startup in x ms
represents how long the server took to start successfully. If you see this you're good!
As a side note, it's best practice to restrict inbound access in your Security Group to certain application ports(i.e. 80 and 443 for a http server) if you're going to allow access from any IP. This will prevent people on the public internet from trying to brute force SSH connections on port 22 and other vulnerabilities.
Upvotes: 0
Reputation: 11
Almost by chance I came across the solution whilst tinkering. I added a rule into the security group to which the EC2 instance belongs allowing inbound HTTP access from any IP address.
It would be great if someone could confirm that this is the correct configuration though.
Upvotes: 1