Set up Unison for Two Way Syncing on 2 Centos Servers

Have been played with both Async and Unison, I found Unison is more powerful, especially on 2 way syncing include deletion. Unison is easy to get start as well.

You can setup Unison by compiling the source, but it is not as easy as I thought – I ran into some libraries dependency conflicts.

Luckily, I am working on Centos servers. I can just use Yum to install it.

Enable Fedora EPEL repos for your Yum with protectbase

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
yum install yum-protectbase.noarch -y
yum repolist

Install Unison via Yum

yum install unison -y

Enable SSH Access without Password

On local host, do these:

ssh-keygen
#followed by three ENTERs
ssh-copy-id -i .ssh/id_rsa.pub root@remotehost
ssh root@remotehost

Sample Unison Command

/usr/bin/unison /web/live1 ssh://remoteserver/web/live2 \
-ignore "Path WEB-INF/config" \
-ignore "Path WEB-INF/derby" \
-ignore "Path WEB-INF/test/test.xml"

Reference

HowTo Use unison File Synchronizer
3 Steps to Perform SSH Login Without Password Using ssh-keygen & ssh-copy-id

Centos 6.2 Net Install vs Minimal Install

The other day, I was asked to set up Zabbix monitor system for a client. Quickly checked up, it runs well in Centos – my favour Linux. Let us get started.

I always prefer to use latest version of Centos, as the date of this article, Centos 6.2 just came out.

To avoid big download bandwidth to the client’s office, I was looking two options: 1, Centos 6.2 Minimal  2, Centos 6.2 Net Install

You can find both versions for download in here: (ISO)

http://isoredirect.centos.org/centos/6/isos/i386/

Centos 6.2 Minimal Installation

The ISO only 200+MB. With this ISO, you can install a very very basic running Centos system, not even the base tools. You are mostly like need to ‘yum groupinstall base’ after system boots up. I would go this option, but I don’t want to waste too much time wondering which packages are missing and reinstalling them.

PS. During the installation, you won’t be asked to choose packages to install. You can only install more packages with Yum after.

Centos 6.2 Net Installation

ISO is 100+MB. You will need network for sure. During installation, it will ask you to config the network (or just DHCP). You will also need to put in the Centos 6.2 online images: [Your nearest Centos image mirror]/centos/6.2/os/i386/

The installation took me a while and you will be asked to choose couple of installation types: Desktop, Minimal, Basic Server …. For the difference, please see this link: CentOS 6 “Default” Installation Options

I chose “Basic Server”. After installation, the whole system is about 1.5G.

Hope this would help some one with the Centos 6 installation.

Zend Magento Installation Guide

For a successful e-commerce website, the speed is very important. That’s why we need to consider Zend Server + Magento.

Here is a quick installation guide to help you get started.

Environment: VPS from Rackspace (Centos 5.4)

  1. download zend+magento from Magento Download Page
  2. modify zend.repos.rpm in [ISV] section:  (This could be a bug in the installation script)
    before:
    http://repos.zend.com/isv/rpm/pe/noarch/
    after:
    http://repos.zend.com/isv/rpm/noarch/
  3. run ./install_zs.sh   (This will install everything for you. Apache2, Zend, MYSQL, Magento ….).
  4. Open Server firewall to allow access from port: 80 and 10081 (Zend Server Console)
    iptables -I RH-Firewall-1-INPUT 9 -p tcp –dport 80 -j ACCEPT
    iptables -I RH-Firewall-1-INPUT 9 -p tcp –dport 10081 -j ACCEPT
  5. visit http://<yourserver>:10081 to change zend server admin password
  6. Change MYSQL password:
    mysqladmin -u root password <new password>
    mysqladmin -u root -h <local hostname> <new password>
  7. Create a MYSQL user just for Magento:
    grant all privileges on magento.* to magentodbuser@localhost identified by ‘magentodbpassword*’
    vim /usr/share/magento/app/etc/local.xml
    to put new dbuser and dbpassword in Magento’s configure file
  8. I don’t know what’s default password to login to Magento Admin Panel, so I changed it directly in MYSQL:
    go to magento database to change password for admin user:
    update admin_user set password = MD5(‘temppassword’) where user_id = 1
  9. After login to Magento Admin Panel, you will get a warning message to change {baseurl}, and here we go:
    in admin panel, system configuration, web, UnSecure and Secure
    change {{base_url}} in Base URL (only) to http://yourdomainname
  10. Done.

Let me know if it helps. Thanks.