Archive for the ‘linux’ Category

LibXML Segmentation fault

Monday, June 21st, 2010

I have been getting intermittent segfaults with Ruby Enterprise Edition 2010.01 on both Mac OSX Snow Leopard 10.6, and Centos 5.3 with LibXML:

See the LibXML Rubyforge page more details, but the solution is to code your document finders as below...

RVM gotcha and ARCHFLAGS on snow leopard

Monday, June 21st, 2010

After installing Ruby Enterprise Edition 2010.02 via RVM, I was getting seg faults in the native gems. The solution was easy:

I think i will be adding ARCHFLAGS="-arch x86_64" to my bash_login....

Installing Centos on VMWare Fusion

Wednesday, August 5th, 2009

I recently created a couple of Centos virtual machines, and took notes of all the steps. You can use these notes for both installing another VM, or for building a production server.

We used these VMs for running staging and production instances of a Ruby on Rails deployment.

Install Centos 5.3 64 bit

VM configuration settings

- Redhat Linux Enterprise 5 64 bit
- 30 GB drive
- 2 CPU
- 1 GB memory
- Network: bridged

Server install settings:

- use default settings for drive partitions
- set network address to: IP_ADDRESS_GOES_HERE IP version 4
- hostname: HOSTNAME
- gateway: GATEWAY
- primary dns: DNS1
- disable IP version 6
- net mask: 255.255.255.0
- timezone: Pacific/Auckland
- System clock uses UTC: tick
- set root password to PASSWORD_YEAH_RIGHT
- Additional tasks: none

SETUP TASKS

- yum update
- yum install sudo
- adduser nigeluser
- passwd nigeluser
- adduser marcususer
- passwd marcususer

visudo

- add lines at bottom of file:
nigeluser ALL=(ALL) ALL
marcususer ALL=(ALL) ALL

PACKAGES

- sudo yum install ruby
- wget http://rubyforge.org/frs/download.php/58677/ruby-enterprise-1.8.6-20090610.tar.gz
- tar xvfz ruby-enterprise-1.8.6-20090610.tar.gz
- sudo yum install httpd
- sudo yum install gcc-c++
- sudo yum install zlib-devel
- sudo yum install openssl-devel
- sudo yum install readline-devel
- sudo ./installer (ruby tar directory)
- sudo ln -s /opt/ruby-enterprise/bin/cap /usr/bin/cap
- sudo ln -s /opt/ruby-enterprise/bin/capify /usr/bin/capify
- sudo ln -s /opt/ruby-enterprise/bin/erb /usr/bin/erb
- sudo ln -s /opt/ruby-enterprise/bin/gem /usr/bin/gem
- sudo ln -s /opt/ruby-enterprise/bin/integrity /usr/bin/integrity
- sudo ln -s /opt/ruby-enterprise/bin/irb /usr/bin/irb
- sudo ln -s /opt/ruby-enterprise/bin/rails /usr/bin/rails
- sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/rake
- sudo ln -s /opt/ruby-enterprise/bin/rdoc /usr/bin/rdoc
- sudo ln -s /opt/ruby-enterprise/bin/ruby /usr/bin/ruby
- sudo yum remove ruby
- sudo yum install httpd-devel apr-devel
- sudo yum install mysql-devel
- sudo /opt/ruby-enterprise/bin/passenger-install-apache2-module
- sudo yum install mysql-server
- sudo /sbin/chkconfig httpd on
- sudo /sbin/chkconfig mysqld on
- sudo yum install ncurses-devel
- wget http://downloads.sourceforge.net/sourceforge/htop/htop-0.8.3.tar.gz?use_mirror=transact
- tar xcfz htop-0.8.3.tar.gz
- cd htop-0.8.3
- ./configure
- make
- sudo make install
- wget http://kernel.org/pub/software/scm/git/git-1.6.3.3.tar.bz2
- bunzip2 files/git-1.6.3.3.tar.bz2
- tar xvf files/git-1.6.3.3.tar
- ./configure
- make
- sudo make install
- sudo gem install mysql –no-rdoc –no-ri — –with-mysql-config=/usr/bin/mysql_config

START APPS

- copy /system/mysql/my.cnf to /etc/my.cnf
- sudo /sbin/service mysqld start
- /usr/bin/mysqladmin -u root password ‘PASSWORD_GOES_HERE’
- sudo /sbin/service httpd start

CAPISTRANO

- cap staging deploy:setup
- cap staging deploy:cold
- cap staging deploy

CONFIGURE

- sudo /usr/sbin/adduser deploy
- sudo passwd deploy

VMWARE TOOLS

- Login as root
- Select from VMware Workstation: go to VM> Install VMware Tools
- mkdir /root/mn
- From the VM: mount the virtual cd drive , this should be done with the guest OS (CentOS ) command line:
mount /dev/cdrom /root/mn
- From the CDROM extract VMware Tools into /tmp/ directory
tar -C /tmp -zxvf /root/mn/VMwareTools-5.5.3-34685.tar.gz
- Running VMware Tools installation/setup script
cd /tmp/vmware-tools-distrib
./vmware-install.pl
- This is VMware Tools installation/setup script, it will ask for confirmation to begin the installation
answer the defaults for each question
- when done, restart the VM (shutdown -r now)