Wednesday, August 27, 2014

How to install memcahe on a cpanel server

For CentOS 6 64 bit,

wget http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-7.noarch.rpm
yum install memcached
vi /etc/sysconfig/memcached
# Running on Port 11211
PORT="11211"

# Start as memcached daemon
USER="memcached"

# Set max simultaneous connections to 1024
MAXCONN="1024"

# Set Memory size to 2048 - 4GB(4096)
CACHESIZE="2048"

#Set server IP address
OPTIONS="-l 127.0.0.1"

chkconfig --levels 235 memcached on
/etc/init.d/memcached start

Then, install PHP memcache

pecl install memcache
service httpd restart


Monday, August 25, 2014

Install and configure Postgresql in Centos

How to install and configure Postgresql in Centos

yum install postgresql postgresql-server
chkconfig postgresql on
service postgresql initdb
service postgresql start

Now Postgresql has been installed in your box.

From Windows client i need to connect with this postgresql server. For that i download and install  pgAdminIII http://www.pgadmin.org/download/

Before getting connect, we have to allow remote clients to get connection in the server

Login to the postgresql box
su - postgres
vi /var/lib/pgsql/data/postgresql.conf
Change the line "listen_address='localhost'" to listen_address='*'
Uncomment port 5432 
max_connections=100

Also we have to mention the client IP to allow/trust in postgresql server

vi  /var/lib/pgsql/data/pg_hba.conf  
host all all 192.168.1.0/24 md5
host all all 192.168.3.0/24 md5
 

Restart the service.

Now i can connect to postgresql server from the windows client using the pgAdmin tool 

Thursday, August 14, 2014

Resolving alfresco to port 80

I need to change the default port of alfresco (http://ip:8080/share) to listen on port 80(http://ip/share)
My alfresco verion is 3.4 community edition
OS is windows 2008 R2

We need to edit two configuration files for listening alfresco from port 8080 to 80.

1. tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml
    Change all ports from 8080 to the desired port
    Save file

2. tomcat/conf/server.xml
    Find the line having ajp
    Change the connector port from 8080 to 80
     Save file

Restart alfresco service.

Try to access http://ip/share
Login with your credentials.

Thursday, July 3, 2014

task blocked for more than 120 seconds.

When running some high workloads on UEK kernels on systems with a lot of memory you might see the following errors in /var/log/messages:

INFO: task bonnie++:31785 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
bonnie++      D ffff810009004420     0 31785  11051               11096 (NOTLB)
ffff81021c771aa8 0000000000000082 ffff81103e62ccc0 ffffffff88031cb3
ffff810ac94cd6c0 0000000000000007 ffff810220347820 ffffffff80310b60
00016803dfd77991 00000000001312ee ffff810220347a08 0000000000000001
Call Trace:
[<ffffffff88031cb3>] :jbd:do_get_write_access+0x4f9/0x530
[<ffffffff800ce675>] zone_statistics+0x3e/0x6d
[<ffffffff88032002>] :jbd:start_this_handle+0x2e5/0x36c
[<ffffffff800a28b4>] autoremove_wake_function+0x0/0x2e
[<ffffffff88032152>] :jbd:journal_start+0xc9/0x100
[<ffffffff88050362>] :ext3:ext3_write_begin+0x9a/0x1cc
[<ffffffff8000fda3>] generic_file_buffered_write+0x14b/0x675
[<ffffffff80016679>] __generic_file_aio_write_nolock+0x369/0x3b6
[<ffffffff80021850>] generic_file_aio_write+0x65/0xc1
[<ffffffff8804c1b6>] :ext3:ext3_file_write+0x16/0x91
[<ffffffff800182df>] do_sync_write+0xc7/0x104
[<ffffffff800a28b4>] autoremove_wake_function+0x0/0x2e
[<ffffffff80062ff0>] thread_return+0x62/0xfe
[<ffffffff80016a81>] vfs_write+0xce/0x174
[<ffffffff80017339>] sys_write+0x45/0x6e
[<ffffffff8005d28d>] tracesys+0xd5/0xe0

This is a know bug. By default Linux uses up to 40% of the available memory for file system caching. After this mark has been reached the file system flushes all outstanding data to disk causing all following IOs going synchronous. For flushing out this data to disk this there is a time limit of 120 seconds by default. In the case here the IO subsystem is not fast enough to flush the data withing 120 seconds. This especially happens on systems with a lof of memory.
The problem is solved in later kernels and there is not “fix” from Oracle. I fixed this by lowering the mark for flushing the cache from 40% to 10% by setting “vm.dirty_ratio=10″ in /etc/sysctl.conf. This setting does not influence overall database performance since you hopefully use Direct IO and bypass the file system cache completely.

Saturday, June 21, 2014

Error while installing rpm elfutils-libelf-devel package

[root@shivin RPMs]# rpm -ivh elfutils-libelf-devel-0.137-3.el5.x86_64.rpm
warning: elfutils-libelf-devel-0.137-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
error: Failed dependencies:
        elfutils-libelf-devel-static-x86_64 = 0.137-3.el5 is needed by elfutils-libelf-devel-0.137-3.el5.x86_64
[root@shivin RPMs]# rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm
warning: elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
error: Failed dependencies:
        elfutils-libelf-devel-x86_64 = 0.137-3.el5 is needed by elfutils-libelf-devel-static-0.137-3.el5.x86_64


Solution:
Some packages need to be installed together because they depend on each other.




[root@shivinl RPMs]# rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm elfutils-libelf-devel-0.137-3.el5.x86_64.rpm
warning: elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:elfutils-libelf-devel  ########################################### [ 50%]
   2:elfutils-libelf-devel-s########################################### [100%]
[root@shivin RPMs]#

Wednesday, May 14, 2014

PHP5-fpm error log

Hey,


This is the error I am getting


[13-May-2014 09:50:53] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-May-2014 09:51:01] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-May-2014 09:51:43] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-May-2014 09:57:37] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it

I am using ubuntu12.04 and nginx with php5-fpm. When load get increased in my server i am getting the following error in /var/log/php5-fpm.log

Solution:

grep -r -l "pm.max_children" /etc/*
Copy the file /etc/php5/fpm/pool.d/www.conf to a safe location
Edit the following values
pm = dynamic
pm.max_children = 100
pm.start_servers = 25
pm.min_spare_servers = 10
pm.max_spare_servers = 40
pm.max_requests = 1000


/etc/init.d/php5-fpm restart
 /etc/init.d/nginx restart

This helps

Thursday, March 13, 2014

How to disable bug search without login to bugzilla

I have a bugzilla account, which only authorized users can login and add bugs. Public have no rights to post a bug, edit or comment. But public have privellage to search the bugs.

This is because end users when adding bugs they have to enable an option “Only users in all of the selected groups can view this bug” to restrict the view from public.

Solution : Login as admini user, Navigate to Administration, Parameters, User Authentication
Change the value of requirelogin to On.