| Home Register Memberlist Help Search Quick Links No Replies |
|
||||||
| Basic How-tos Help Us Noobs by Sharing Your Wisdom |
![]() |
![]() |
|
Thread Tools | ![]() |
|
#1
|
||||
|
||||
|
Installing mongoDB on Centos 5
If you want to install mongoDB on CentOS, it is pretty straightforward. Here are the steps: 1. Add the mongoDB repository In the /etc/yum.repos.d/CentOS-Base.repo file, add the following lines if your system is CentOS 5 64-bit: Code:
[10gen] name=10gen Repository baseurl=http://downloads.mongodb.org/distros/centos/5.4/os/x86_64/ gpgcheck=0 Code:
[10gen] name=10gen Repository baseurl=http://downloads.mongodb.org/distros/centos/5.4/os/i386/ gpgcheck=0 Run the following commands: Code:
yum update yum install mongo-stable yum install mongo-stable-server To start mongo, run the following command: Code:
service mongod start If you receive the following error when either trying to start mongo or trying to get into the command line interface: Code:
# mongo MongoDB shell version: 1.4.4 url: test connecting to: test Sun Jul 4 11:53:03 JS Error: Error: couldn't connect: couldn't connect to server 127.0.0.1 127.0.0.1:27017 (anon):952 Sun Jul 4 11:53:03 User Exception 12513:connect failed exception: connect failed mongoDB Drivers Of note, depending on which scripting language you will be using for mongo, you would need to obtain the drivers for that language. A list of the available drives can be found at this location. I intend to provide instructions on installing the drivers for Perl, PHP and Ruby in future posts in this thread. Configuration File Finally, if you want to see the configuration options for mongo, you can view the configuration file for it at /etc/mongod.conf I would imagine any changes made to that file require mongo to be restarted with the service mongod restart command. Monitoring and Diagnostics There is an HTTP monitor automatically set to the server's hostname on port 28017, so you can normally point your browser to http://hostname.domain.com:28017/ and get details such as reads, writes, locks and so on. Another tool is mongostat in root shell. You can use the --help flag to see the options for it.
__________________
Miraenda ~ Ex uno disce omnes ~ |
|
#2
|
||||
|
||||
|
Installing PHP mongoDB Driver and phpMoAdmin GUI Interface
To use mongo with PHP, you would simply install it via PECL. Since my machine has cPanel, I did it this way in WHM > Software > Module Installers > PHP Pecl > Manage. On the new screen, I entered mongo below the "Install a PHP Pecl" area, then clicked the Install Now button. The cPanel PECL program actually places the extension into /usr/local/lib/php.ini for you at the top: Code:
extension="mongo.so" At that point, you can then use an application called phpMoAdmin to handle managing the databases via a GUI if you prefer. The program can be installed this way: Code:
cd /home/username/public_html/ wget http://www.phpmoadmin.com/file/phpmoadmin.zip unzip phpmoadmin.zip Code:
//$accessControl = array('scott' => 'tiger');
Code:
$accessControl = array('scott' => 'tiger');
To change the phpMoAdmin theme (3 choices), you can edit this line: Code:
define('THEME', 'swanky-purse');
Enjoy!
__________________
Miraenda ~ Ex uno disce omnes ~ |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. |
||