In MongoDB, how do I change the name of the server/daemon, or create a new server with a name other than localhost
? The docs specify a way to connect to a server with a specific name, such as localhost
(the --host
option on the mongo
command), as well as a way to specify the names of each server in a replication set, which I forget at the moment, but not a method to say the name of the server to create an instance of for the mongod
command. It seems to have to be localhost
.
I have node.js
and apache
, so I can use virtual hosting, and I obviously have a hosts
file (/etc/hosts
on Unix-like OS's and C:\WINDOWS\System32\drivers\etc\hosts
on Windows), so I can presumably create a server with a different name from localhost
, but the question is can I do this with the built-in commands like mongod
, or with a configuration file?