theKindOfMe

November 19, 2010

Ubuntu 10.04, Nginx with Upload and Upload Progress Modules, RVM, Postgresql

Filed under: Uncategorized — Tags: , , — yasi8h @ 2:02 am

Had to setup a staging server recently. Thought of putting down the steps i followed in to a article. This thing is getting fun.

General Stuff

We need these libraries in order to compile the following stuff

sudo apt-get install build-essential libssl-dev libpcre3-dev git-core

These are some nice to have tools, install only if you use them.

sudo aptitude install htop

You might also want to run update-db so that locate would work.

sudo update-db

Nginx from Source

We are going to get nginx 0.7.65 with upload and upload progress modules and compile them from source. Please note that additional command line options passed in to some commands bellow via two ‘-‘ character might get jumbled up by blog/editor. So if you get any unusual errors while running the following commands check whether you are typing in the correct chars (if you do a copy paste you might be trying to execute some html chars that make no sense for the command you are running).

wget http://nginx.org/download/nginx-0.7.65.tar.gz
tar xzf nginx-0.7.65.tar.gz

wget https://github.com/masterzen/nginx-upload-progress-module/tarball/v0.8.2 –no-check-certificate
tar zxf masterzen-nginx-upload-progress-module-v0.8.2-0-g8b55a34.tar.gz

wget http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gz
tar zxf nginx_upload_module-2.2.0.tar.gz

cd nginx-0.7.65
./configure –add-module=../masterzen-nginx-upload-progress-module-8b55a34/ –add-module=../nginx_upload_module-2.2.0/
make
sudo make install

Ruby 1.8.7 with RVM

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
nano ~/.bashrc
source ~/.rvm/scripts/rvm
rvm install 1.8.7
rvm use 1.8.7 –default

Rails 2.3.5

We want to install an older version of rails so

gem install rails -v 2.3.5

Postgresql 8.4

sudo apt-get install postgresql-8.4
sudo nano /etc/postgresql/8.4/main/pg_hba.conf

Towards the end of the file look for a line like

local all postgres ident

and replace it with this line

local all all trust

The above line would allow full access to the db from the localhost WITHOUT any PASSWORD. So yeah be sure you know what you are doing. You could replace trust keyword with the md5 to enable password authentication.

sudo /etc/init.d/postgresql restart

Postgresql installation have already added a user called postgres. And this user can can connect to the db and have admin rights. So connect as postgres and add a user account and create a db. Be sure to give all the needed privileges to the user account you are creating. So that it can create new dbs…etc.

createuser builder -U postgres
createdb builder_development -U builder

Ruby Gems needed for postgresql – ruby integration

sudo apt-get install postgresql-server-dev-8.4
gem install pg

Thats it for me. Hope this helps.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: