MongoDB Documentation, Release 3.0.4 Note: All three options require root privileges. The first two options each requires a system reboot and may have larger implications for your deployment. SELINUX=disabled SELINUX=permissive semanage port -a -t mongod_port_t -p tcp 27017 Note: You can use setenforce to change to permissive mode; this method does not require a reboot but is not persistent. Warning: On RHEL 7.0, if you change the data path, the default SELinux policies will prevent mongod from having write access on the new data path if you do not change the security context. You may alternatively choose not to install the SELinux packages when you are installing your Linux operating system, or choose to remove the relevant packages. This option is the most invasive and is not recommended. Warning: On RHEL 7.0, if you change the data path, the default having write access on the new data path if you do not change the security context. The MongoDB instance stores its data files in /var/lib/mongo and its log files in /var/log/mongodb by default, and runs using the mongod user account. You can specify alternate log and data file directories in /etc/mongod.conf . See systemLog.path and storage.dbPath for additional information. If you change the user that runs the MongoDB process, you must modify the access control rights to the /var/lib/mongo and /var/log/mongodb directories to give this user access to these directories. Data Directories and Permissions Step 1: Start MongoDB. You can start the mongod process by issuing the following command: sudo service mongod start Step 2: Verify that MongoDB has started successfully You can verify that the mongod process has started suc- cessfully by checking the contents of the log file at /var/log/mongodb/mongod.log for a line reading [initandlisten] waiting for connections on port <port> where <port> is the port configured in /etc/mongod.conf , 27017 by default. You can optionally ensure that MongoDB will start following a system reboot by issuing the following command: sudo chkconfig mongod on Chapter 2. Install MongoDB 36 • Enable access to the relevant ports (e.g. 27017) for SELinux if in enforcing mode. See Default MongoDB Port (page 424) for more information on MongoDB’s default ports. For default settings, this can be accom- plished by running • Set SELinux to permissive mode in /etc/selinux/config by changing the SELINUX setting to permissive . • Disable SELinux entirely by changing the SELINUX setting to disabled in /etc/selinux/config .