Monday, March 19, 2012

About Incron

Install incron

Type the following command under RHEL / Fedora / CentOS Linux:
$ sudo yum install incron
Type the following command under Debian / Ubuntu Linux:
$ sudo apt-get install incron

Configuration Files

  • /etc/incron.conf - Main incron configuration file
  • /etc/incron.d/ - This directory is examined by incrond for system table files. You should put all your config file here as per directory or domain names.
  • /etc/incron.allow - This file contains users allowed to use incron.
  • /etc/incron.deny - This file contains users denied to use incron.
  • /var/spool/incron - This directory is examined by incrond for user table files which is set by users running the incrontab command.

incron Syntax

The syntax is as follows:
    options
/var/www/html IN_CREATE /root/scripts/backup.sh
/sales IN_DELETE /root/scripts/sync.sh
/var/named/chroot/var/master IN_CREATE,IN_ATTRIB,IN_MODIFY /sbin/rndc reload
Where,
  • - It is nothing but path which is an absolute filesystem path such as /home/data. Any changes made to this path will result into command or action.
  • - Mask is is nothing but various file system events such as deleting a file. Each event can result into command execution. Use the following masks:
    • IN_ACCESS - File was accessed (read)
    • IN_ATTRIB - Metadata changed (permissions, timestamps, extended attributes, etc.)
    • IN_CLOSE_WRITE - File opened for writing was closed
    • IN_CLOSE_NOWRITE - File not opened for writing was closed
    • IN_CREATE - File/directory created in watched directory
    • IN_DELETE - File/directory deleted from watched directory
    • IN_DELETE_SELF - Watched file/directory was itself deleted
    • IN_MODIFY - File was modified
    • IN_MOVE_SELF - Watched file/directory was itself moved
    • IN_MOVED_FROM - File moved out of watched directory
    • IN_MOVED_TO - File moved into watched directory
    • IN_OPEN - File was opened
    • The IN_ALL_EVENTS symbol is defined as a bit mask of all of the above events.
  • - Run command or scripts when mask matched on given directory.
  • options - It can be any one of the following with command (i.e. you can pass it as arg to your command):
    1. $$ - dollar sign
    2. $@ - watched filesystem path (see above)
    3. $# - event-related file name
    4. $% - event flags (textually)
    5. $& - event flags (numerically)

Turn Service On

Type the following command:
# service incrond start
# chkconfig incrond on

Examples:

Type the following command to edit your incrontab
incrontab -e
Run logger command when file created or deleted from /tmp directory:
/tmp IN_ALL_EVENTS logger "/tmp action for $# file"
Save and close the file. Now cd to /tmp and create a file:
$ cd /tmp
$ >foo
$ rm foo

Friday, March 2, 2012

How to install Kaltura CE V4.0 on Centos

Install the required packages



Add 2 repos

## Remi Dependency on CentOS and Red Hat (RHEL)

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm



yum install httpd php php-cli curl php-gd mysql-server mysql php-mysql php-xml

yum install php-devel zlib-devel

Install Memcached package:

yum install memcached

yum –enablerepo=remi install memcached

# Set Memcached to start automatically on boot

chkconfig memcached on

# Start Memcached

/etc/init.d/memcached start

## OR ##

service memcached start

Install teh php modules

yum install php php-pecl-memcache

yum install php php-pecl-memcached

================

Verify that the following settings within the php.ini file

For PHP 5.3: Verify that request_order parameter includes C, G and P (recommended: “CGP”)

For PHP 5.2: Verify that variables_order parameter in php.ini includes C, G and P

/etc/php.ini and the / searched for variables_order as I had php 5.2 and set time zone "Asia/calcutta" if ur usinh php5.3

===============

Add this to /etc/my.cnf, ensure it in the mysqld section.

lower_case_table_names=1

thread_stack=262144

open_files_limit=20000

Then restart mysql

service mysqld restart

=======

install the pentaho data integration package

mkdir /usr/local/pentaho

cd /usr/local/pentaho

wget http://sourceforge.net/projects/pentaho/files/Data%20Integration/3.2.0-stable/pdi-ce-3.2.0-stable.tar.gz/download

tar xvfz pdi-ce-3.2.0-stable.tar.gz -C /usr/local/pentaho

mv data-integration pdi

==========

Disable SELinux (if installed)

vi /etc/sysconfig/selinux

SELINUX=disabled

===

Get Kaltura

cd /usr/src/

register in http://www.kaltura.org/ and wget community edition kaltura.v4

=====

Now run the install.php and following the instructions.

apachectl path

php path

mysql user ;- root

mysql password ;- root password/blank

Once installation has completed follow the final instructions of adding your host to the /etc/hosts file and updating your httpd.conf to include kaltura config.

You need to create start scripts for the search daemon and batch manager, so

cd /etc/init.d/
ln -s /opt/kaltura/app/scripts/searchd.sh kaltura-searchd
ln -s /opt/kaltura/app/scripts/serviceBatchMgr.sh kaltura-serviceBatchMgr


should start these proceess
=================================================

Configure Canvas

In a web browser, go to http://kalturadev.example.com/start/

    Click on Admin Console (right image) and log in.
    Click Add New Publisher sub-tab under Publishers tab and add the new user.
    On Publisher Management page, select Manage in the Action dropdown menu for the new Publisher. This will log you in to the management console as that publisher.
    Click the Settings tab at the top.
    Click the Integration Settings sub-tab.

Copy the two IDs and Secret keys to the canvas/config/kaltura.yml file settings as follows:

Partner ID => partner_id
Sub Partner ID => subpartner_id
Administrator Secret => secret_key
User Secret => user_secret_key

    Click on Studio tab.

Select one of these players or add a new one, and copy the ID number for it to the canvas/config/kaltura.yml file for the player_ui_conf and upload_ui_conf values (I was told upload_ui_conf doesn’t matter yet, so not sure what should go here).

To get the kcw_ui_conf value, you need to log into the mysql db on the kaltura server:

> mysql -u root -p
mysql> use kaltura;
mysql> select * from ui_conf where obj_type=2;

Pick one of these (such as “default KCW for KMC”) and copy the “id” number to canvas/config/kaltura.yml for the kcw_ui_conf value.

Set the remaining canvas/config/kaltura.yml settings while here:

domain: kaltura server url (no http://)
resource_domain: same as above

Restart Canvas Apache and Canvas_init.

Tuesday, February 21, 2012

Installing Jenkins-CI integrated to Github

Installing Jenkins-CI integrated to Github

Step 1. Prerequisites.
* Make sure you have root access.
* Jenkins uses java. Make sure you have java installed. Check your java version by:
java -version
If you don't have java, installing it is as easy as pie:
yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel


Step 2. Installing Jenkins
We just have to get the RedHat Jenkins repo and install it via yum like this:
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.reposudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.keysudo yum install jenkins
The Jenkins config file is located in /etc/sysconfig/jenkins. You can modify port settings, log directories on the config file by running:
sudo nano /etc/sysconfiig/jenkins
Verify if jenkins has installed properly by invoking its startup script:
sudo /etc/init.d/jenkins start
The server by default will run at port 8080. Setup a virtual host if this doesn't work for you. Stop or restart the server by replacing start with stop/restart.


Step 3. Execute Jenkins
There are two ways to run Jenkins server, either as a stand-alone application, or deployed as a standard web application onto a Java Servlet container or application server such as Tomcat.


java -jar jenkins.war
Access Jenkins by going to http://youserver:8080.

Friday, February 10, 2012

Fix for “convert: no decode delegate for this image format

Fix for “convert: no decode delegate for this image format.

1.identify -list configure

2. check the installed delegates

3. Install missing delegates

4.Go to: http://www.imagemagick.org/download/delegates/ and download the required/missing delegate library.

  1. Execute “gunzip libjpeg-6b.tar.gz”
  2. Execute “tar -xvf libjpeg-6b.tar”
  3. Change directories to the newly created “libjpeg-x”
  4. Execute “./configure”
  5. Execute “make”
  6. Execute “make test”
  7. Execute “make -n install” first to see if the makefile will put the files where you want them.
  8. If there are no errors and you’re ok with the installation path go ahead and install with “make install

Sunday, February 5, 2012

How to Install Linux Malware Detect (LMD)

How to Install Linux Malware Detect (LMD)

Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection
systems to extract malware that is actively being used in attacks and generates signatures for detection. In addition, threat data is also derived from user submissions with the LMD checkout feature and from malware community resources. The signatures that LMD uses are MD5 file hashes and HEX pattern matches, they are also easily exported to any number of detection tools such as ClamAV.

On Centos:

    wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
    tar xfz maldetect-current.tar.gz
    cd maldetect-*
    ./install.sh

    Linux Malware Detect v1.3.4
    (C) 1999-2010, R-fx Networks
    (C) 2010, Ryan MacDonald
    inotifywait (C) 2007, Rohan McGovern
    This program may be freely redistributed under the terms of the GNU GPL

    installation completed to /usr/local/maldetect
    config file: /usr/local/maldetect/conf.maldet
    exec file: /usr/local/maldetect/maldet
    exec link: /usr/local/sbin/maldet
    cron.daily: /etc/cron.daily/maldet

    maldet(32517): {sigup} performing signature update check…
    maldet(32517): {sigup} local signature set is version 2010051510029
    maldet(32517): {sigup} latest signature set already installed

Authenticated SMTP with Postfix on CentOS


Authenticated SMTP with Postfix on CentOS.



#yum install postfix system-switch-mail cyrus-imapd cyrus-plain cyrus-md5 cyrus-utils cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 dovecot.


#vi /etc/postfix/main.cf
      inet_interfaces = all
      relayhost = smtp.*******.com                             
      smtp_sasl_auth_enable = yes
      smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
      smtp_sasl_mechanism_filter = plain, login                  
      smtp_sasl_security_options = noanonymous       

#vi  /etc/postfix/sasl_passwd
  Place the following line to the file : emailserver username:password  (Our email server)

# postmap /etc/postfix/sasl_passwd
  Restart Service.
# /etc/init.d/saslauthd restart
# /etc/init.d/postfix restart

Installing php 5.2+ Installing eAccelerator+ Installing Zend Optimizer


1. Installing php 5.2

# nano /etc/yum.repos.d/CentOS-Testing.repo
and input these code there:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*
after installing:
# yum -y install php
That’s all. We have php 5.2 there

2. Installing eAccelerator:


# wget http://bart.eaccelerator.net/source/0.9.6.1/eaccelerator-0.9.6.1.tar.bz2
# tar fvx eaccelerator-0.9.6.1.tar.bz2
# yum -y install gcc-c++ make php-devel
# cd eaccelerator-0.9.6.1
# phpize
# ./configure && make && make install
# mkdir /var/tmp/eaccelerator
# chmod 777 /var/tmp/eaccelerator
# nano /etc/php.ini
and insert following strings there
[eAccelerator]
eaccelerator.shm_size=”32″
eaccelerator.cache_dir=”/var/tmp/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”3600″
eaccelerator.shm_prune_period=”1800″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
eaccelerator.keys = “shm”
eaccelerator.sessions = “shm”
eaccelerator.content = “shm” [Zend]
zend_extension=/usr/lib64/php/modules/eaccelerator.so
Restart apache and check php:
service httpd restart
php -v

3. Installing Zend Optimizer:

# wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
# tar fvx ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
Copy directory content of ZendOptimizer-3.3.9-linux-glibc23-x86_64 to /etc/zend
Insert following string into php.ini:
zend_extension=/etc/zend/data/5_2_x_comp/ZendOptimizer.so
That’s all falks. I have:
[root@host ~]# php -v
PHP 5.2.10 (cli) (built: Nov 13 2009 11:44:05)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies