5

When I start the config server I can see the following line in the logger:

[websvr] admin web console waiting for connections on port 27017

So, I wonder if mongo use a web server for maintaining config data?

Phalguni Mukherjee
  • 623
  • 3
  • 11
  • 29

2 Answers2

6

(All of this assumes you're using the current version of MongoDB, 2.4 or higher)

No, MongoDB does not use a Web server in any way for configuration or administration (as documented here). There is a minimal web server for some other purposes however.

Configuration is done through configuration files or the command line when MongoDB is started.

There is a basic, optionally configured, web page that contains some statistics that may of interest to administrators documented here and called the Http Console. If enabled, it's available by default at http://localhost:28017. It can be disabled via the nohttpinterface option documented here. Also, there is a not recommended for production REST api that can be used for some test and development tasks.

As an example, I just confirmed that the nohttpinterface setting was not set to true in a configuration file (I have a custom port in this example as I have another MongoDB instance already running)

verbose=true
port=25017

I then started MongoDB. In the log file, this was present:

Thu Sep 26 11:11:06.645 [websvr] admin web console waiting for connections on port 26017
Thu Sep 26 11:11:06.645 [initandlisten] waiting for connections on port 25017

Then, I added the nohttpinterface option to the configuration file:

verbose=true
port=25017
nohttpinterface=true

After restarting MongoDB, I could not access the Http Console. The web server was not started (there was no reference to the websvr in the log this time).

Thu Sep 26 11:11:34.028 [initandlisten] waiting for connections on port 25017

Oops! Google Chrome could not connect to localhost:26017

jordan
  • 9,570
  • 9
  • 43
  • 78
WiredPrairie
  • 58,954
  • 17
  • 116
  • 143
  • Prairie I am able to view it through browser even if I make nohttpinterface=true and in my server it gets started at port 27017 – Phalguni Mukherjee Sep 26 '13 at 15:45
  • What's "it" that you're viewing? – WiredPrairie Sep 26 '13 at 15:58
  • Prairie same as the http console in this page:http://docs.mongodb.org/ecosystem/tools/http-interfaces/#http-interface – Phalguni Mukherjee Sep 26 '13 at 16:08
  • It's @WiredPrairie. :) I just added `nohttpinterface=true` to a MongoDB configuration file. Started MongoDB. I could not access the Http Console. I then shut down MongoDB. I removed the line with `nohttpinterface` and restarted MongoDB. I then could access it. Try changing the default port to a different number: `port=25017`. The HttpConsole will be at a port 1000 higher, so `http://localhost:26017`. – WiredPrairie Sep 26 '13 at 16:10
  • my default port is on 26017 so I am able to access it in 27017,i stopped mongod,and than made nohhpinterface true,than again started mongod but i am able to access.I am using centos – Phalguni Mukherjee Sep 26 '13 at 16:14
  • Great! :) I added more evidence. – WiredPrairie Sep 26 '13 at 16:18
0

Yes mongodb has a built in admin interface. You can read up on the HTTP interface at http://docs.mongodb.org/ecosystem/tools/http-interfaces/#http-interface

Todilo
  • 1,256
  • 3
  • 19
  • 38