Hi, I created a droplet with Ubuntu 14.04 x64 and LAMP where I uploaded a codeigniter framework with working scripts. This works fine because I receive a Codeigniter error.
I also created a droplet with Ubuntu MongoDB 3.0.5 on 14.04.
Now what I want is to connect the Codeigniter framework with that MongoDB. How can I do this? My codeigniter frameworks works local with a local MongoDB so I tried to change the config file of my MongoDB lib but still receive ‘Unable to connect to your database server using the provided settings.’
These are the details from the Codeigniter file: (I removed confidential information).
// Generally localhost
$config['host'] = "[THE IP OF THE MONGODB DROPLET]";
// Generally 27017
$config['port'] = 27017;
// The database you want to work on
$config['db'] = "[A DATABASE NAME]";
// Required if Mongo is running in auth mode
$config['user'] = "root";
$config['pass'] = "[PASSWORD FOR THE ROOT USER]";
Any idea?
Thanks Wouter
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
By default, the MongoDB One-Click App is configured with MongoDB bound to localhost, so that it is only accessible locally. For all the details, see:
In order to make it accessible externally, modify the value of bind_ip in /etc/mongod.conf Setting up a firewall so that only your LAMP Droplet can access the MongoDB Droplet is also a good idea. Using UFW on your MongoDB instance, you would run:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow from lamp.droplet.ip.addr
sudo ufw enable
You should make sure to review the security checklist from the MongoDB documentation before making your database accessible externally as well.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.