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

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.

March 20, 2014

Create an FTP user on a cPanel server from shell

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

Well today I wanted to make a script to automatically create some user for an account from shell, that’s because they where to many to make them manually from cpanel/whm . Also this command work on your server even if you have pure-ftpd or proftpd ) , because the cpanel keep the virtual user information into /etc/proftpd/ ( also there is a all user/password into /etc/proftpd/passwd.vhosts ) .

So , how to add a ftp user from shell ?
Well the syntax is :
/usr/local/cpanel/bin/proftpd_passwd -a ::::::

So first of all we have to know the uid and gid for this we can grep the passwd file.
grep /etc/passwd

Example how to add a username for matrafox system user :
grep matrafox /etc/passwd
matrafox:x:xxx:yyy::/home/matrafox:/usr/local/cpanel/bin/noshell
/usr/local/cpanel/bin/proftpd_passwd matrafox -a testuser:testpassword:xxx:yyy:matrafox:/home/matrafox/public_html:/sbin/nologin

If you want to detele a user the syntax is:
/usr/local/cpanel/bin/proftpd_passwd -d

Also if you manually edit a file you should run also the command so changes to take effect :
/usr/local/cpanel/bin/ftpupdate

March 10, 2014

rpm – Find out what files are in my rpm package

Filed under: Linux — Tags: , , , — admin @ 10:59 am

Use following syntax to list the files for already INSTALLED package:
rpm -ql package-name

Use following syntax to list the files for RPM package:
rpm -qlp package.rpm

February 26, 2014

how to delete bounce emails for non existent users vpopmail

Filed under: Linux — Tags: , , , — admin @ 5:28 pm

The last parameter in the .qmail-default file tells vdelivermail what to do with non-matching emails. The default is to bounce the email back to the sender. But you can also delete it instead.

update your .qmail-default file from something like this:
| /home/vpopmail/bin/vdelivermail ” bounce-no-mailbox

to something like this:
| /home/vpopmail/bin/vdelivermail ” delete

« Newer PostsOlder Posts »

Powered by WordPress