N
N
nikitasius2011-04-21 20:59:08
PHP
nikitasius, 2011-04-21 20:59:08

Nginx + php-fpm not finding domains?

I decided to test php-fpm. I installed
it out of the box, launched it, read habr and runet made a config for nginx. Everything works great.
Then I decided to kill php by installing chroot

chroot = /usr/webusers/<br/>
<br/>
chdir = /

And after the restart, the forum engine (installed for the test) showed that it could not find the database server ( localhost).
127.0.0.1solved the problem, but googling found a note that you need to copy some files to the chroot.
copied
[email protected]:/usr/webusers/lib# l<br/>
total 100K<br/>
-rw-r--r-- 1 root root 30K Jan 24 03:09 libnss_compat.so.2<br/>
-rw-r--r-- 1 root root 22K Jan 24 03:09 libnss_dns.so.2<br/>
-rw-r--r-- 1 root root 42K Jan 24 03:09 libnss_files.so.2<br/>
<br/>
[email protected]:/usr/webusers/etc# l<br/>
total 16K<br/>
-rw-r--r-- 1 root root 9 Aug 7 2006 host.conf<br/>
-rw-r--r-- 1 root root 286 Mar 23 01:23 hosts<br/>
-rw-r--r-- 1 root root 475 Aug 28 2006 nsswitch.conf<br/>
-rw-r--r-- 1 root root 132 Mar 21 17:57 resolv.conf

copied even more than the norm. Restarted service php5-fpm restartand even eventually restarted the server init 6.
The result is null.
Config php.ini- increased memory to 256MB, config php-fpm( <a href="http://www.conf">www.conf</a>) - lines about chroot, everything else in them as is. Debian6
server
Linux minisrv2 2.6.32-5-686-bigmem #1 SMP Tue Mar 8 22:14:55 UTC 2011 i686 GNU/Linux

php-fpm plows under www-data account.
even did in directory chroot'a
chown -R www-data:www-data etc<br/>
chown -R www-data:www-data lib
, restarted php-fpm, to no avail ... I have no idea
what could be the matter.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim, 2011-04-22
@nikitasius

I don't understand, the problem is that you can't connect to mysql on localhost? the easiest way is to leave 127.0.0.1 and not warm your head.
if you want blood from the nose exactly localhost, then it is obvious that in this case the connection goes through a socket, which is not in your chruta. throw mysql socket into chroot and you will be happy.

A
AlexeyK, 2011-04-21
@AlexeyK

and in a broad gull to us suggest to look?

J
justhack, 2011-04-22
@justhack

Well, like a comrade, it's time to see the access rights. If you have nginx, then user nobody is registered in the config in any way, and the rights from your ls -la to root:root.

N
nikitasius, 2011-04-23
@nikitasius

regarding the launch:
nginx is launched not under nobody, but under usrnginx users (the user has his own group). the same user is included in the www-data group, which allows nginx to give out static that was uploaded to the server from the www-data group.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question