How to Install MongoDB on Cpanel Server

How to Install MongoDB on Cpanel Server

Installing MongoDB is an easy process. To install MongoDB on your Linux Centos Cpanel server

Installing MongoDB on Cpanel Server

As a first step, let’s install MongoDB on our Centos operating system

cd /etc/yum.repos.d
nano -w mongodb.repo

Let’s add it to your file

[mongodb]
name=MongoDB Repo
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

We save and exit with CTRL + X

Now we can install MongoDB

yum install mongo-10gen mongo-10gen-server

During installation, we will ask us some questions and confirm them by entering them all. After completing the installation process, ssh

chkconfig mongod on

You can activate  MongoDB service by entering the command. Finally, let’s add MongoDB to the php.ini file.

pecl install mongo
service httpd restart

To find out whether it is installed or not, enter the command ssh php -i | grep mongo -i and if you output it like this, the installation has been done.

[root@server ixir.d]# php -i | grep mongo -i
mongo
MongoDB Support => enabled
MONGODB-CR => enabled
MONGODB-X509 => enabled
mongo.allow_empty_keys => 0 => 0
mongo.chunk_size => 261120 => 261120
mongo.cmd => $ => $
mongo.default_host => localhost => localhost
mongo.default_port => 27017 => 27017
mongo.is_master_interval => 15 => 15
mongo.long_as_object => 0 => 0
mongo.native_long => 1 => 1
mongo.ping_interval => 5 => 5
[root@server ixir.d]#

As you can see, our installation is over. You can now use MongoDB for Cpanel.

I hope it was a useful article.

Archived Discussion (Read-Only)

These are the original reader comments recovered from the archived site. Commenting is closed on this site.

Abelardo — 13 March 2021

Hi there, It didn’t work for me: No package mongo-10gen available. No package mongo-10gen-server available. Any help would be welcome. Regards.