Installing MongoDB 1.8.1 on Ubuntu 10.04 LTS

A lot of this information will seem obvious to a lot of you. But it did require me to perform a few Google searches, so hopefully I can save you the trouble.

I provide a script to automate this process:

This script is deprecated now. Fortunately 10Gen (the company who makes MongoDB) provides an Apt repository. Do not use the current MongoDB version in the Ubuntu apt sources. It’s version 1.6.*

All you need to do:

vim /etc/apt/sources.list

Add the following line:
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen


apt-get update
apt-get install mongodb-10gen

By default MongoDB runs in trusted mode. This means that it’s listening on port 27017 for any connection. We want it to only listen on localhost.

Edit the file: /etc/mongodb.conf

Add the following lines:
bind_ip 127.0.0.1
noauth = true ##### YOU MUST add this line if you use bind_ip

Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot.

That’s it. Follow me on Twitter: @jprichardson and read my blog on software entrepreneurship.

-JP

Apache Virtual Hosting

This is extremely easy to do.  This was done on Ubuntu 8.04.  Replace “SERVER_IP” with the IP address of your  server.

Edit /etc/apache2/apache2.conf and add the following:

NameVirtualHost SERVER_IP:80

Create a new file “subdomain” in /etc/apache2/sites-available with the content:

<VirtualHost SERVER_IP:80> *

ServerName subdomain.yourdomain.com
DocumentRoot /var/www/subdomain

<Directory “/var/www/subdomain”> **
Order allow,deny
Allow from all
</Directory>

</VirtualHost>

Then run:
a2ensite subdomain
/etc/init.d/apache2 restart

Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot.

Follow

Get every new post delivered to your Inbox.