title: Remotely connecting to MongoDB http interface on EC2 server
body: <p>I cannot connect remotely to my mongodb http interface on my AWS ec2 server. </p>
  
  <p>I've checked the log and verified that it's listening on port 28017. I've verified with netstat -a that tcp port 28017 is open. I've enabled 28017 in the security group.</p>
  
  <p>I get my IP with ifconfig, and try to get to the http interface with IP:28017. Nothing happens. No error, nothing. </p>
  
  <p>I've put rest = true in my mongod.conf file and I start mongod as a service with 'sudo service mongod restart'</p>
  
  <p>I even tried to start mongod with 'sudo mongod --rest' to no avail.</p>
  
  <p>This is what tail -f /log/mongod.conf shows:</p>
  
  <pre><code>Sat Feb  2 02:06:54 [initandlisten] MongoDB starting : pid=3919 port=27017 dbpath=/data 64-bit host=domU-12-31-39-12-3A-A2
  Sat Feb  2 02:06:54 [initandlisten] db version v2.2.2, pdfile version 4.5
  Sat Feb  2 02:06:54 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
  Sat Feb  2 02:06:54 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
  Sat Feb  2 02:06:54 [initandlisten] options: { config: "/etc/mongod.conf", dbpath: "/data", fork: "true", logappend: "true", logpath: "/log/mongod.log", pidfilepath: "/var/run/mongodb/mongod.pid", rest: "true" }
  Sat Feb  2 02:06:54 [initandlisten] journal dir=/data/journal
  Sat Feb  2 02:06:54 [initandlisten] recover : no journal files present, no recovery needed
  Sat Feb  2 02:06:54 [initandlisten] waiting for connections on port 27017
  Sat Feb  2 02:06:54 [websvr] admin web console waiting for connections on port 28017
  </code></pre>
  
  <p>This is what netstat -a shows: </p>
  
  <pre><code>Active Internet connections (servers and established)
  Proto Recv-Q Send-Q Local Address               Foreign Address             State
  tcp        0      0 localhost:smtp              *:*                         LISTEN
  tcp        0      0 *:27017                     *:*                         LISTEN
  tcp        0      0 *:mysql                     *:*                         LISTEN
  tcp        0      0 *:28017                     *:*                         LISTEN
  tcp        0      0 *:ssh                       *:*                         LISTEN
  tcp        0    272 domU-12-31-39-12-3A-A2.:ssh pool-108-54-50-116.ny:50722 ESTABLISHED
  tcp        0      0 *:ssh                       *:*                         LISTEN
  udp        0      0 *:bootpc                    *:*
  udp        0      0 domU-12-31-39-12-3A-A2.c:ntp *:*
  udp        0      0 localhost:ntp               *:*
  udp        0      0 *:ntp                       *:*
  Active UNIX domain sockets (servers and established)
  Proto RefCnt Flags       Type       State         I-Node Path
  unix  2      [ ACC ]     STREAM     LISTENING     5402   @/com/ubuntu/upstart
  unix  2      [ ACC ]     STREAM     LISTENING     40948  /var/lib/mysql/mysql.sock
  unix  2      [ ACC ]     SEQPACKET  LISTENING     5468   @/org/kernel/udev/udevd
  unix  2      [ ACC ]     STREAM     LISTENING     6332   /var/run/dbus/system_bus_socket
  unix  9      [ ]         DGRAM                    6278   /dev/log
  unix  2      [ ACC ]     STREAM     LISTENING     182622 /tmp/mongodb-27017.sock
  unix  3      [ ]         STREAM     CONNECTED     182434
  unix  3      [ ]         STREAM     CONNECTED     182433
  unix  2      [ ]         DGRAM                    182429
  unix  2      [ ]         DGRAM                    131031
  unix  2      [ ]         DGRAM                    40170
  unix  2      [ ]         DGRAM                    19247
  unix  2      [ ]         DGRAM                    7231
  unix  2      [ ]         DGRAM                    7212
  unix  2      [ ]         DGRAM                    7194
  unix  3      [ ]         STREAM     CONNECTED     6341   /var/run/dbus/system_bus_socket
  unix  3      [ ]         STREAM     CONNECTED     6340
  unix  3      [ ]         STREAM     CONNECTED     6336
  unix  3      [ ]         STREAM     CONNECTED     6335
  unix  3      [ ]         DGRAM                    5484
  unix  3      [ ]         DGRAM                    5483
  </code></pre>