Wednesday, July 28, 2010

Setting up a UAT box remotely

I am not much in to unix environment. So, when I had to setup a UAT box remotely, I had a score of issues and after a lot reading, learning, trying and asking I reached a set of commands that worked. This is not very specific to the requirement I had.. installing ruby on rails 1.2.3 and postgres on Fedora 12 machine using putty. I know it's a very old version. I wish I could secretly upgrade the version overnight. But it's not possible especially when product is already in production.

Anyway, here are the steps to set up the box that just had Fedora 12 installed and had access to internet.

Installing postgres
yum -y install postgresql postgresql-server postresql-devel


Installing ruby
wget ftp://ftp.ruby-lang.org//pub/ruby/1.8/ruby-1.8.6-p399.tar.gz
tar -xzvf ruby-1.8.6-p399.tar.gz
cd ruby-1.8.6-p399
./configure
make


Checking Ruby installation
ruby -v


Installing rubygems
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.2.tgz
tar -xzvf rubygems-1.3.2.tgz
cd rubygems-1.3.2
ruby setup.rb


Installing all the required gems
gem install rails -v=1.2.3 --include-dependencies
gem install pg -- --with-pgsql-include-dir='/usr/include/pgsql' --with-pgsql-lib-dir='/usr/lib/pgsql'
gem install postgres
gem install mongrel
gem install rubyzip
yum install fcgi fcgi-devel
gem install fcgi -r -- --with-fcgi-lib=/usr/local/fcgi/lib --with-fcgi-include=/usr/local/fcgi/include


Restoring the database

[root@uvt eProfile]# su postgres
-bash-4.0$ psql template1
template1=# create database extranet owner postgres;
template1=# \q
[root@uvt eProfile]# psql -U postgres -d extranet -f db.out


After doing all this, placing the application and starting the server. I wasn't still able to access the application via browser. Later the Admin found that it was due to unix internal firewall. Huff! twas a tough time. But, tough times never last, tough people do.

No comments:

Post a Comment