FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-02-2012, 02:26 AM
"siefke_listen@web.de"
 
Default Nginx with PHP-FPM

Hello,

I try my web hosting environment to mirror locally. On my Rootserver run Nginx
with PHP-FPM under FreeBSD. So i has installed Nginx, PHP and Mysql here local
on Gentoo. But something is not correct, it want not really run. I has search
in web and use the config for Nginx on Gentoo (is other as on FreeBSD) but
nothing happen. The website (info.php) is blank and in logs i find not the way
which is my mistake.

nginx.conf > http://nopaste.info/72a40e9c5e.html
php-fpm.conf > http://nopaste.info/94a9de62d5.html
emerge --info php nginx > http://nopaste.info/225b12e106.html


<error_log>
2012/04/02 04:23:05 [notice] 3636#0: using the "epoll" event method
2012/04/02 04:23:05 [notice] 3636#0: nginx/1.0.14
2012/04/02 04:23:05 [notice] 3636#0: OS: Linux 3.3.0
2012/04/02 04:23:05 [notice] 3636#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2012/04/02 04:23:05 [notice] 3637#0: start worker processes
2012/04/02 04:23:05 [notice] 3637#0: start worker process 3640
</error_log>

<localhost.access_log>
127.0.0.1 - - [02/Apr/2012:04:23:11 +0200] "GET /favicon.ico HTTP/1.1" 404 348 "-" "-" "-"
127.0.0.1 - - [02/Apr/2012:04:23:11 +0200] "GET /favicon.ico HTTP/1.1" 404 319 "http://localhost/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de-de) AppleWebKit/535+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Midori/0.4" "-"
127.0.0.1 - - [02/Apr/2012:04:23:11 +0200] "GET /favicon.ico HTTP/1.1" 404 348 "-" "-" "-"
127.0.0.1 - - [02/Apr/2012:04:23:17 +0200] "GET /info.php HTTP/1.1" 200 260 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de-de) AppleWebKit/535+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Midori/0.4" "0.47"
127.0.0.1 - - [02/Apr/2012:04:23:17 +0200] "GET /info.php HTTP/1.1" 200 260 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; de-de) AppleWebKit/535+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ Midori/0.4" "0.47"
127.0.0.1 - - [02/Apr/2012:04:23:17 +0200] "GET /favicon.ico HTTP/1.1" 404 348 "-" "-" "-"
127.0.0.1 - - [02/Apr/2012:04:23:17 +0200] "GET /favicon.ico HTTP/1.1" 404 348 "-" "-" "-"
</localhost.access_log>

<localhost.error_log>
2012/04/02 04:23:11 [error] 3640#0: *1 open() "/var/www/localhost/htdocs/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2012/04/02 04:23:11 [info] 3640#0: *1 client 127.0.0.1 closed keepalive connection
2012/04/02 04:23:11 [error] 3640#0: *2 open() "/var/www/localhost/htdocs/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost", referrer: "http://localhost/"
2012/04/02 04:23:11 [error] 3640#0: *3 open() "/var/www/localhost/htdocs/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2012/04/02 04:23:11 [info] 3640#0: *3 client 127.0.0.1 closed keepalive connection
2012/04/02 04:23:17 [error] 3640#0: *8 open() "/var/www/localhost/htdocs/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2012/04/02 04:23:17 [info] 3640#0: *8 client 127.0.0.1 closed keepalive connection
2012/04/02 04:23:17 [error] 3640#0: *9 open() "/var/www/localhost/htdocs/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2012/04/02 04:23:17 [info] 3640#0: *9 client 127.0.0.1 closed keepalive connection
</localhost.error_log>


Has someone a idea where is the mistake. Thank u for help.

Regards
Silvio
 
Old 04-02-2012, 09:01 AM
Michael Schreckenbauer
 
Default Nginx with PHP-FPM

On Monday 02 April 2012 04:26:47 siefke_listen@web.de wrote:
> Hello,
>
> I try my web hosting environment to mirror locally. On my Rootserver run
> Nginx with PHP-FPM under FreeBSD. So i has installed Nginx, PHP and Mysql
> here local on Gentoo. But something is not correct, it want not really run.
> I has search in web and use the config for Nginx on Gentoo (is other as on
> FreeBSD) but nothing happen. The website (info.php) is blank and in logs i
> find not the way which is my mistake.
>
> nginx.conf > http://nopaste.info/72a40e9c5e.html
> php-fpm.conf > http://nopaste.info/94a9de62d5.html
> emerge --info php nginx > http://nopaste.info/225b12e106.html

I'm not really an expert with ngingx and php-fpm, but afaict the error is in
the location line in nginx.conf.
You have:
location ~ .php$ {
...
Afaik this only matches the exact file ".php"

Try changing it to
location ~ ^(.*).php$ {
...
This would match all files ending in ".php"

> Regards
> Silvio

Hth,
Michael
 
Old 04-02-2012, 12:17 PM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,

On Mon, 02 Apr 2012 11:01:46 +0200
Michael Schreckenbauer <grimlog@gmx.de> wrote:

> I'm not really an expert with ngingx and php-fpm, but afaict the error is in
> the location line in nginx.conf.
> You have:
> location ~ .php$ {
> ...
> Afaik this only matches the exact file ".php"
>
> Try changing it to
> location ~ ^(.*).php$ {
> ...
> This would match all files ending in ".php"

thanks for advice. But nothing happen the result is same like before.
Blank website, no phpinfo output.

In logs stand only "closed keepalive connection, can it be that something
in php-fpm.conf not correct is set?


Regards
Silvio
 
Old 04-02-2012, 12:30 PM
Michael Schreckenbauer
 
Default Nginx with PHP-FPM

On Monday 02 April 2012 14:17:47 Silvio Siefke wrote:
> Hello,
>
> On Mon, 02 Apr 2012 11:01:46 +0200
>
> Michael Schreckenbauer <grimlog@gmx.de> wrote:
> > I'm not really an expert with ngingx and php-fpm, but afaict the error is
> > in the location line in nginx.conf.
> > You have:
> > location ~ .php$ {
> > ...
> > Afaik this only matches the exact file ".php"
> >
> > Try changing it to
> > location ~ ^(.*).php$ {
> > ...
> > This would match all files ending in ".php"
>
> thanks for advice. But nothing happen the result is same like before.
> Blank website, no phpinfo output.
>
> In logs stand only "closed keepalive connection, can it be that something
> in php-fpm.conf not correct is set?

to get more info from nginx, try to increase the log level, eg
error_log /var/log/nginx/error_log debug;
php-fpm.conf looks correct to me.
You include fastcgi.conf. Could you post the contents?

> Regards
> Silvio

Best,
Michael
 
Old 04-02-2012, 04:02 PM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,

On Mon, 02 Apr 2012 14:30 +0200
Michael Schreckenbauer <grimlog@gmx.de> wrote:

> to get more info from nginx, try to increase the log level, eg
> error_log /var/log/nginx/error_log debug;
> php-fpm.conf looks correct to me.
> You include fastcgi.conf. Could you post the contents?


The fastcgi.conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;


I have write debug not info in error log.

<localhost.error_log>
2012/04/02 17:59:24 [info] 21288#0: *4 client closed prematurely connection
while reading client request line, client: 192.168.0.20, server: localhost
</localhost.error_log>

<localhost.access_log>
192.168.0.20 - - [02/Apr/2012:17:59:05 +0200] "GET / HTTP/1.1" 200 633 "-"
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko)
Chrome/18.0.1025.142 Safari/535.19" "-"

192.168.0.20 - - [02/Apr/2012:17:59:05 +0200] "GET /favicon.ico HTTP/1.1" 200 1650
"-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko)
Chrome/18.0.1025.142 Safari/535.19" "-"

192.168.0.20 - - [02/Apr/2012:17:59:21 +0200] "GET /info.php HTTP/1.1" 200 289
"-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko)
Chrome/18.0.1025.142 Safari/535.19" "0.47"

192.168.0.20 - - [02/Apr/2012:17:59:24 +0200] "-" 400 0 "-" "-" "-"
</localhost.access_log>

No phpinfo output. Its strange.


Regards
Silvio
 
Old 04-03-2012, 02:00 AM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,


i have now setup a Freebsd box in Vmware and build the environment, has
no problem, run without any problems. Strange that not run on Gentoo.

I have changed the Gentoo Nginx config to Freebsd Nginx config, but the
result is the same. Blank white page.

nginx.conf > http://nopaste.info/98104d56da.html

In log can only read:
<access.log>
192.168.0.20 - - [03/Apr/2012:03:55:07 +0200] "GET /info.php HTTP/1.1" 200 29
"-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko)
Chrome/18.0.1025.142 Safari/535.19" "-"
</acces.log>

<error.log>
2012/04/03 03:55:25 [info] 4055#0: *2 client closed prematurely connection
while reading client request line, client: 192.168.0.20, server: localhost
</error.log>

<php-fpm.log (activate debug>
[03-Apr-2012 03:56:25.988472] DEBUG: pid 3825,
fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently
0 active children, 1 spare children, 1 running children. Spawning rate 1
</php-fpm.log>

Has someone a idea?


Thx, Regards
Silvio
 
Old 04-03-2012, 10:49 AM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,

nginx list dialog:

On Tue, 3 Apr 2012 04:02:14 -0400 (EDT)
"locojohn" <nginx-forum@nginx.us> wrote:

> mkdir -p /var/run/fastcgi/php-fpm.sock
>
> php-fpm.conf:
>
> ;listen = 127.0.0.1:9000
> ;listen.allowed_clients = 127.0.0.1
> listen = /var/run/fastcgi/php-fpm.sock
> listen.owner = nginx
> listen.group = nginx
>
> nginx.conf:
>
> location .php$ {
> include fastcgi_params;
> fastcgi_pass unix:/var/run/fastcgi/php-fpm.sock;
> }

Thx for advice. But will not run. When i start nginx it come only

gentoo-desk ~ # /etc/init.d/nginx start
* Checking nginx' configuration ...
nginx: [emerg] invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35
nginx: configuration file /etc/nginx/nginx.conf test failed
* failed, please correct errors above [ !! ]
* ERROR: nginx failed to start


<error_log>
2012/04/03 12:44:52 [emerg] 2062#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35
2012/04/03 12:44:52 [emerg] 2063#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35
2012/04/03 12:45:02 [emerg] 2073#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35
2012/04/03 12:45:02 [emerg] 2074#0: invalid host in upstream "/var/run/fastcgi/php-fpm.sock" in /etc/nginx/nginx.conf:35
</error_log>


Mmh can it be that nginx and / or php not right build with emerge?



Regards
Silvio
 
Old 04-03-2012, 09:39 PM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,


Could someone possibly provide me the USE flags available
if someone has run Nginx, PHP and Fpm.

It were nice.

Regards
Silvio
 
Old 04-04-2012, 08:14 PM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,


now i have build php and nginx from source direct, emerge --unmerge,
have downloaded the sourcecode and compile it and same it run not.

Thats really crazy, what is this? Is this maybe with eselect profile list
option? Because i use

gentoo-desk imap # eselect profile list
Available profile symlink targets:
[1] default/linux/x86/10.0
[2] default/linux/x86/10.0/selinux
[3] default/linux/x86/10.0/desktop *
[4] default/linux/x86/10.0/desktop/gnome
[5] default/linux/x86/10.0/desktop/kde
[6] default/linux/x86/10.0/developer
[7] default/linux/x86/10.0/server
[8] hardened/linux/x86
[9] hardened/linux/x86/selinux

Is this maybe the mistake or where can be the error?


Regards
Silvio
 
Old 04-05-2012, 12:32 AM
Silvio Siefke
 
Default Nginx with PHP-FPM

Hello,

ok i have found the problem. Maybe is it the php.ini files, because i has
deactivated the ini files at all and the system run. But in disable_functions
is not set phpinfo, why nginx give it not out?


Regards
Silvio
 

Thread Tools




All times are GMT. The time now is 05:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org