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

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

May 9, 2014

apache child pid exit signal Segmentation fault

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

Well today I face a strange problem. My apache start throw some segmentation fault into error log. So how to find out what is the problem ?

Well first of all we have to enable the coredump for apache, so in orde to do this we can add this line at the start of httpd.conf
CoreDumpDirectory /path
( Some put the path to /tmp directory but please be aware that for me core have 2.2G , so if you have a small /tmp partition you can put it in other place , but it have to be into a directory with same user/group as apache run ) .

We restart the apache and wait to see a segmentation fault again into error_log, and we will see that he say something about path also
For example:
[notice] child pid 4959 exit signal Segmentation fault (11), possible coredump in /var/www/html

If don’t say anything about path then something is not ok, most probably you have to check properties for path.

After this we find out where is located apache , so for this a
which httpd
/usr/sbin/httpd

Should be ok .
After this we have to run
gdb httpd_path core_path
gdb /usr/sbin/httpd /var/www/html/core

We will see something like this

....
....
....
Loaded symbols for /lib64/libgpg-error.so.0
Reading symbols from /usr/lib64/php/modules/zip.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/php/modules/zip.so
Reading symbols from /usr/lib64/gconv/ISO8859-1.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/gconv/ISO8859-1.so
Core was generated by `/usr/sbin/httpd'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f278f5a5c29 in zend_hash_index_find () from /etc/httpd/modules/libphp5.so
Missing separate debuginfos, use: debuginfo-install httpd-2.2.15-30.el6.centos.x86_64
(gdb)

Ok now we run
where
(gdb) where
And now is the magic to see what is causing the problem.

For me was
#0 0x00007f278f5a5c29 in zend_hash_index_find () from /etc/httpd/modules/libphp5.so
#1 0x00007f2789b98661 in my_copy_zval (dst=0x7f279e2e8dd0, src=0x7f2709eee8d0, ctxt=0x7fff0d4c3900) at /var/tmp/APC/apc_compile.c:314
#2 0x00007f2789b9176d in zif_apc_fetch (ht=, return_value=0x7f279e2e8dd0, return_value_ptr=, this_ptr=, return_value_used=)
at /var/tmp/APC/php_apc.c:858
#3 0x00007f278f5e8498 in ?? () from /etc/httpd/modules/libphp5.so
#4 0x00007f278f5bf5e0 in execute () from /etc/httpd/modules/libphp5.so
#5 0x00007f278f58ff35 in zend_call_function () from /etc/httpd/modules/libphp5.so
#6 0x00007f278f4e7c37 in ?? () from /etc/httpd/modules/libphp5.so
#7 0x00007f278f5e8498 in ?? () from /etc/httpd/modules/libphp5.so
#8 0x00007f278f5bf5e0 in execute () from /etc/httpd/modules/libphp5.so
#9 0x00007f278f5997ed in zend_execute_scripts () from /etc/httpd/modules/libphp5.so
#10 0x00007f278f547878 in php_execute_script () from /etc/httpd/modules/libphp5.so
#11 0x00007f278f622e55 in ?? () from /etc/httpd/modules/libphp5.so
#12 0x00007f279adfebb0 in ap_run_handler ()
#13 0x00007f279ae0246e in ap_invoke_handler ()
#14 0x00007f279ae0d96c in ap_internal_redirect ()
#15 0x00007f2791cfc855 in ?? () from /etc/httpd/modules/mod_rewrite.so
#16 0x00007f279adfebb0 in ap_run_handler ()
#17 0x00007f279ae0246e in ap_invoke_handler ()
#18 0x00007f279ae0db30 in ap_process_request ()
#19 0x00007f279ae0a9a8 in ?? ()
#20 0x00007f279ae066b8 in ap_run_process_connection ()
#21 0x00007f279ae12977 in ?? ()
#22 0x00007f279ae12c8a in ?? ()
#23 0x00007f279ae1390c in ap_mpm_run ()
#24 0x00007f279adea900 in main ()

To quit from gdb we have to type quit .

For me the problem was the apc, I have increased the memory_limit, and the problem is fixed .

Also some interesting link I found here

Generate PHP core dumps on segfaults in PHP-FPM

April 23, 2014

vsftpd dot file .htaccess is not visible

Filed under: Linux — Tags: , , , — admin @ 3:44 pm

Well long time no post. Latest problem that I found was that I didn’t see the dot file on ftp client.
The ftp server was vsftdp.

The fix is
force_dot_files=YES

Of course you have to restart the vsftdp server after adding this line to conf.

April 15, 2014

Easter fonts

Filed under: Scrambled — Tags: , , — admin @ 7:48 am

Well I was searching some fonts for upcoming event , that is Easter and I found this blog with some interesting collections.

http://www.fontocean.com/10-font-easter/
Best 10 font for easter

« Newer PostsOlder Posts »

Powered by WordPress