Wednesday, April 10, 2013

HOWTO install phpDaemon on CentOS 6.X


The problem is that I can't find PECL modules and some libs for them in repos (standard + remi) or packages versions was to old for phpdaemon. No yum, no easy updates, only source codes =(

Step 1: Install all necessary for building from source. Remember if you don't use remi as a php repo, remove  --enablerepo=remi from yum command below.
yum --enablerepo=remi install php-devel openssl-devel gcc make git

Step 2: Get libevent2 and install it (in my case in /opt/libevent2)
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable/
./configure --prefix=/opt/libevent2
make && make install

Step 3: Install PECL modules
pecl install event
Don't forget to set libevent installation prefix [/usr] : /opt/libevent2

pecl install eio
pecl install proctitle-alpha

git clone git://github.com/zenovich/runkit.git
cd runkit/
phpize
./configure --prefix=/opt/runkit
make && make install


Step 4: Install phpdaemon
cd /opt
git clone git://github.com/kakserpom/phpdaemon.git
ln -s /opt/phpdaemon/bin/phpd /usr/bin/phpd

Step 5: Configure phpdaemon for your needs =)

Saturday, April 6, 2013

SSH config makes your life easier

How to simplify your day-to-day ssh usage with config file!

As you know there is a rule called '90/10'. 90 percent of users use only 10 percent of software capabilities. And it works not only for huge programs as MS Office but even for small utilities like ps, ls or ssh.
I used ssh for many years as some kind of barbarian who found microscope and uses it for chopping nuts!

Why am I writing all this? Because only one file can save a lot of keyboard clicks!
Ssh client looks for ~/.ssh/config file to apply configuration for new session. Simple example:

Host home
  Hostname 192.168.0.100
  User root
  Port 222

To ssh to your home you can only type ssh home instead of
ssh -p 222 root@192.168.0.100            

You can use Host as a mask for several hosts:

Host webfe* *.company.com db*.hosting.com
  User root
  IdentityFile ~/.ssh/key

And Host * can be set as a default settings for all sessions:

Host *
  Compression yes
  CompressionLevel 7
  Cipher blowfish

See man ssh_conf for more sugar!