4
votes

Sorry if this question has been asked before.

I have an Amazon instance (Ubuntu Server 12.04.1 LTS) and installed Tomcat version (Apache Tomcat/6.0.36). It works as expected on port 80, but not on port 8080. (Not working means "Can not connect to Web Application Manager").

  • My Security Group configuration has port 8080 opened for http*
22 (SSH)    0.0.0.0/0   Delete
80 (HTTP)   0.0.0.0/0   Delete
8080 (HTTP*)    0.0.0.0/0   Delete
  • I have both jdk and jre installed, even I do not know why I need jdk if tomcat running on port 8080.
  • I have configured tomcat to bind on IPV4 address by having
<Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" address="0.0.0.0"/>

at server.xml and adding

JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
echo $JAVA_OPTS

to setenv.sh

Runnung netstat -ln gives me

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
udp        0      0 0.0.0.0:68              0.0.0.0:*                          
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     5886     @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     7285     /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     SEQPACKET  LISTENING     6077     /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     7397     /var/run/acpid.socket

Running wget http://localhost:8080 gives me

--2013-04-11 11:20:40--  http://localhost:8080/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7446 (7.3K) [text/html]
Saving to: `index.html'

100%[=====================================================================================================================================================================>] 7,446       --.-K/s   in 0s      

2013-04-11 11:20:40 (294 MB/s) - `index.html' saved [7446/7446]

So, did I miss anything?

Thanks!!

3

3 Answers

5
votes

Login AWS Console and navigate to Security groups.

  1. Remove the HTTP (80) if there is one.
  2. Select custom TCP rule and enter the port as "8080"
  3. Click on apply rule.

Add DNS Name :8080

It should work now.

0
votes

Please check your Amazon EC2 instace's security settings or ELB's security settings(if you are using that). My best guess is that 8080 is not exposed

0
votes

...I'm working to resolve this exact issue myself.

I interpret part of your question to mean that you have correctly configured and applied a security group to your server that allows HTTP on port 80 and access to port 8080 as well. (The version of the Security Group manager I'm using works a little differently from the one you're using I believe.)

Having applied a rule that opens port 80, I can get responses both internally and externally on port 80.

On the other hand, I have added a rule to open port 8080 and cannot get a response from that. (On the host itself, my wget(1) test worked as yours did. A test of my server with lynx(1) also worked.)

Some hints at a solution seem to imply that HTTP should be associated with the port in the rule, but the configurator in the EC2 dashboard doesn't allow application protocol to be associated with the rule.

All I see is port, protocol (TCP in this case), and source address range.

I'm sure my local firewall is not blocking port 8080. So I'm stumped...

---v