Tuesday, May 24, 2011

Build your own Cloud

Will try this one day... heh.

DIY cloud computing

+

smart load balancing, scaling, etc...

=

DIY Amazon EC2 ... maybe :P

Monday, April 11, 2011

Upgrading CentOS packages


yum update

OR

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update
shutdown -r now


OR

yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update mkinitrd nash
yum update kernel\*
yum update
shutdown -r now


Friday, April 8, 2011

Installing Magento 1.5.0.1 on CentOS 5.5

CentOS 5.5 (x64 architecture) setup for Magento Commerce version 1.5.0.1

1. Install CentOS 5.4 (because it is only 1DVD, 5.5 is 2 DVDs – troublesome)


2. Remove unnecessary rpms (ppp, rp-pppoe, irda-utils, pcmciautils, wireless_supplicant, ypbind, yp-tools, etc)


3. Update yum – “yum update yum”


4. Update the rest of the rpms – “yum update”


5. Reboot (kernel update)


6. Install Atomicorp rpm repository –

wget -q -O - http://www.atomicorp.com/installers/atomic | sh


7. Install php rpms (these are for magento mainly)

a. php

b. php-devel

c. php-cli

d. php-common

e. php-gd

f. php-mbstring

g. php-mcrypt

h. php-mysql

i. php-pdo

j. php-xml

php-xml will provide the DOM extension required by Magento.


8. There is no need to install php-mhash explicitly, it is included in php 5.3+. It depends on php-common for 5.2, and will cause a depsolving problem (dependency issue, as the rest are using 5.3+ already).


9. Compulsory changes to /etc/php.ini :

a. short_open_tag = On


10. Recommended changes to /etc/php.ini:

a. memory_limit = 64M

b. max_execution_time = 18000

c. magic_quotes_gpc = off

d. flag session.auto_start = off

e. zlib.output_compression = on

f. suhosin.session.cryptua = off

g. zend.ze1_compatibility_mode = off


11. Not sure about extension=mcrypt.so yet, the comment was:

; PHP for some reason ignores this setting in system php.ini

; and disables mcrypt if this line is missing in local php.ini

New update: I think mcrypt extension is not handled in /etc/php.d/mcrypt.ini.

If the files in /etc/php.d are processed after php.ini are processed, then it makes sense why mcrypt.ini will take precedence over the setting in php.ini


12. Magento only supports APC php opcode optimizer. However, the same dependency issue surfaces. *sigh*

To solve it, install php-devel, php-pear, and then

pecl update-channels

pecl install apc (just use the default options for now)

One good thing about compiling APC from scratch this way is that you get it optimized for your system. Bad thing is, you need to manage the updating/upgrading yourself.


Thursday, April 7, 2011

Tracks (getontracks) installation

Tracks - http://www.getontracks.org/

1. Version 2 RC 2
2. Required dependencies: RedCloth and sanitize.

Environment:
1. CentOS 5.5 x64
2. Enterprise Ruby Edition 1.8.7 separate install into /opt

Followed instructions as per the installation manual

Error when trying to rake migrate:db, dependencies missing RedCloth and sanitize.

gem install sanitize leads to error.
gem install nokogiri leads to error.

To solve:
gem install rails-sanitize

It will install nokogiri, sanitizie and a whole bunch of other dependencies for you and Tracks got on track :)

Friday, March 25, 2011

Atomic Corp + Magento + php-mcrypt x64

Magento
Atomic Corp's rpm repository

wget -q -O - http://www.atomicorp.com/installers/atomic | sh

yum install php-mcrypt.x86_64

Thursday, March 24, 2011

Importing HUGE databases

Assumptions:
1. Huge means over 1GB or possibly 1TB (not tested) on MySQL.
2. This means that using tools like PhpMyAdmin, etc are not feasible (timeout, php.ini constraints, etc)

Problems:
1. MySQL dumps are NOT done in order of table dependencies. So it is highly possible that your dependent child table is created before the parent table is created in the SQL script. This is especially more so if you have a lot of tables in the database.

Solution:
1. Need to disable the foreign key constraint checks.

Constraint:
1. You can open up a 1GB file for editing, unless you have uber cool tools like UltraEdit on a Windows machine (almost nothing else works - vim in cygwin, vim in *nix, I dunno but please correct if I'm wrong).

Reference:

How?
mysql> SET foreign_key_checks = 0; 
mysql> SOURCE dump_file_name; 
mysql> SET foreign_key_checks = 1;

That's it, more or less.

Wednesday, March 23, 2011

Resetting MySQL password on Win 7

1. You MUST (ie. MUST MUST MUST MUST MUST) start the command prompt with "Run as Administrator"!

2. Then you can follow the instructions at:

If you do not start as Administrator, your "user" (even if he has Administrator rights) will not be able to access MySQL binary and data path. It will create a new instance of the database somewhere in
C:\Users\MySuperDuperUselessAdminUser\AppData\Local\VirtualStore\ProgramData\MySQL\blah blah blah...
And this is wrong. Even if you reset the password here, when you start the actual instance via Windows Service, it will go back to the actual datastore location and you will still fail to login.

Yes, it took me 1hour+ to get this sorted out. Hope this saves someone some pain.

GRR...