clint-tseng/odkbuild — Issue #10: GUIDE Instalation ODK BUILD CentOS by jluis859
Author: jluis859
Created: 2011-12-14 19:14:13+00:00
State: open

GUIDE Instalation ODK BUILD CentOS by jluis859

#Create a dir install "mycentos" is your centos dir
mkdir /home/mycentos/install/
cd /home/mycentos/install/

#Install dependencies
sudo yum install httpd-devel\
openssl-devel\
zlib-devel\
gcc\
gcc-c++\
curl-devel\
expat-devel\
gettext-devel\
mysql-server\
mysql-devel

#Install ruby

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=/usr/local
make
make install

#back
cd ..

wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar xzvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
./configure --prefix=/usr/local --enable-shared --disable-install-doc --with-opt-dir=/usr/local/lib
make
make install

#back
cd ..

#Install Rails
sudo gem install rails

#Install Bundle
sudo gem install bundle

#Install Tokyo Tyrant DB for odk build, IMPORTANT
# Some libs
yum install gzip bzip2 bzip2-devel

#Tokyo cabinet
wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz
tar zxf tokyocabinet-1.4.47.tar.gz
cd tokyocabinet-1.4.47
./configure
make
make install

#back
cd ..

#Tokyo tyrant
wget http://fallabs.com/tokyotyrant/tokyotyrant-1.1.41.tar.gz
tar zxf tokyotyrant-1.1.41.tar.gz
cd tokyotyrant-1.1.41
./configure
make
make install

#back
cd ..

#Install git
# Add the repository
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

# Install the latest version of git
yum install --enablerepo=webtatic git-all

#Download odk from github with git
mkdir odk
cd odk
git clone git://github.com/clint-tseng/odkbuild.git

#Install gemfile
cd odkbuild
bundle install --path .rubygems

#Copy and rename config.yml.sample to config.yml
cp config.yml.sample config.yml

#Start DB TokyoTyrant
rake db:dev:start

#Start Default Server Webrick with 8084 port
bundle exec rackup config.ru -p 8084

#If webrick doesnt work with external private Ips install Thin

#Install alternative server thin
sudo gem install thin

#Start Server with thin -p myport start and that's all, if have problems with rake 1.3.4
#maybe you should change the gemfile and bundle install again
thin -p 8084 start