Cloud Foundry - How to Bootstrap a System in Centos6


1)install febootstrap Febootstrap is a tool like debootstrap in ubuntu.
#yum -y install febootstrap
#febootstrap centos6 rootfs
Threre is a basic centos system in rootfs dir.

2)install ruby 1.9 (optional) yum -y groupinstall "Development Tools"
yum -y install openssl-devel zlib-devel gcc gcc-c++ make autoconf readline-devel curl-devel expat-devel gettext-devel readline-devel

tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=/opt/soft/yaml
make && make install

tar xzvf ruby-1.9.3-p286.tar.gz
cd ruby-1.9.3-p286
./configure --prefix=/opt/soft/ruby --enable-shared --disable-install-doc --with-opt-dir=/opt/soft/yaml
make && make install
ln -s /opt/soft/ruby/bin/* /usr/bin/

gem source -r
gem source -a

gem install bundler --no-rdoc --no-ri
gem install rails --no-rdoc --no-ri
ln -s /opt/soft/ruby/bin/* /usr/bin/

3)install and start cgroups (optional) All of the configuration is here:
vi /etc/cgconfig.conf
Turn it on:
chkconfig --level 3 cgconfig on
chkconfig --list
service cgconfig start

4)turn off selinux vi /etc/selinux/config
Change SELINUX=enforcing to SELINUX=disabled

Reboot or run: setenforce 0

5)supper tool: ip in ssh1:
ip link add name FOO type veth peer name BAR
ip link set FOO netns 1
ifconfig FOO netmask up
ip link set BAR netns route add -host dev FOO

in ssh2:
unshare -n /bin/bash
ifconfig BAR netmask up
ifconfig lo up

in ssh1:

Ha ha, expect my next time write again, write here today, very tired of.