How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

February 17, 2015

How to enable Core Dumps in CentOS

Filed under: Linux — Tags: , , , — admin @ 12:17 pm

To enable core dumps for all daemon, please follow these steps:
Edit the /etc/profile. At line 26 of the file, replace this line:
ulimit -S -c 0 > /dev/null 2>&1

with this line:
ulimit -c unlimited >/dev/null 2>&1

Replace this line (around line 138 ) in /etc/init.d/functions
ulimit -S -c 0 >/dev/null 2>&1

with this:
ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0} >/dev/null 2>&1

Enable core-dumping globally by editing the /etc/sysconfig/init file and adding the line:
DAEMON_COREFILE_LIMIT=’unlimited’

Enable it for specific daemons by adding this line in the /etc/sysconfig/$daemon:
DAEMON_COREFILE_LIMIT=’unlimited’

Optionally, enable core dump for SUID programs:
echo 2 > /proc/sys/fs/suid_dumpable

mkdir /tmp/core
chmod 777 /tmp/core

Edit the /etc/sysctl.conf and add the following:

fs.suid_dumpable = 2
kernel.core_uses_pid = 1
kernel.core_pattern = /tmp/core
Then reload the settings in /etc/sysctl.conf:
sysctl -p

December 16, 2014

Setting up HAProxy with SSL

Filed under: Linux — Tags: , , , , — admin @ 2:02 pm

Well today I was set up a haproxy to use ssl, and did’t figure out from first time how to get only one file for the pem.
In haproxy you have only one file with all certificates.

So the order is this:
cat matrafox.info.key >> matrafox.info.pem
cat matrafox.info.crt >> matrafox.info.pem
cat intermediate.bundle >> matrafox.info.pem

After this just add the
bind *:443 ssl crt /etc/ssl/matrafox.info.pem
And you will have the right one.

October 22, 2014

mod_rpaf and Amazon ELB

Filed under: Linux — Tags: , , , — admin @ 11:26 am

Well is clear that if you want to use the amazon elb, you will not see the $REMOTE_ADDR correctly and you will need mor_rpaf enabled and installed.
If you have a centos / redhat server I found this nice tutorial on this page

mod_rpaf and Amazon ELB
mod_rpaf-0.6-0.7.x86_64.rpm

And add this
LoadModule rpaf_module modules/mod_rpaf-2.0.so

RPAFenable On
RPAFsethostname On
RPAFproxy_ips 10.
RPAFheader X-Forwarded-For

October 20, 2014

Memcached on centos 6.5

Filed under: Linux — Tags: , , , — admin @ 11:57 am

I am trying to install the memcached not the memcache on centos 6.5
Well if you try with pecl install memcached a error will appear and you can’t install it.
A solution is to install it from source.
libmemcached release 1.0.18 – installed from source
php-memcached release 2.1.0 – installed from source & Added memcached.so in php.ini

So basically you download libmemcached and run: configure ; make; make install
And php-memcached and run: phpize; configure; make; make install
After this you can add to /etc/php.d/memcached.ini the line
extension=memcached.so

In order to have sasl please install also this before compiling the libmemcached

yum install cyrus-sasl-devel

May 27, 2014

domain has no valid mail exchangers

Filed under: Linux — Tags: , , , , , — admin @ 8:33 pm

Today I face a strange problem with e-mail won’t be deliver, to a client . I have tested from yahoo, gmail and other service and everything was fine however one client from gmx was complain that he can’t send e-mail to that account

A message that you sent could not be delivered to one or more of
its recipients. This is a permanent error. The following address
failed:

“user@domain.com”:
domain has no valid mail exchangers

So, first impresion was to check if domain.com have a mx . So a short
dig mx domain.com output a

DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 mail.domain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0 ;; QUESTION SECTION: ;domain.com. IN MX ;; ANSWER SECTION: domain.com. 2011 IN MX 10 mail.domain.com.

So it appear that is there.
But the problem was when I query to see who is the mail.domain.com

dig mail.domain.com

DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 mail.domain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0 ;; QUESTION SECTION: ;mail.domain.com. IN A ;; ANSWER SECTION: mail.domain.com. 1937 IN CNAME domain.com. domain.com. 1937 IN A xxx.xxx.xxx.xx ;; AUTHORITY SECTION: domain.com. 1932 IN NS dns1.domain.com. domain.com. 1932 IN NS dns2.domain.com. ;; Query time: 3 msec

So we see that mail.domain.com is a CNAME, it appear that is against rfc , and need to be A zone and not alias/CNAME.
So the solution is to modify mail.domain.com to be A xxx.xxx.xxx.xxx

Regards

« Newer PostsOlder Posts »

Powered by WordPress