You are not logged in.

#1 2012-03-25 16:43:51

snafle
Member
Registered: 2008-04-08
Posts: 41

Nginx, php-fpm and MythWeb give blank page

I'm trying to using nginx and php-fpm to display mythweb. I have got to the point where nginx serves me a blank page with a http 200 reponse, however I can't make it do anything useful. I followed these instructions (http://www.mythtv.org/wiki/MythWeb_on_Nginx) to get it working, changing the file locations such. I'm serving some static files and proxying to another server as well, so nginx itself seems to work alright.

My nginix conf is:

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    server {
        listen       80;
        server_name  localhost;
        root   /srv/http;
        index  index.html index.htm;
        location / {
        }
        location ~ ^/~(.+?)(/.*)?$ {
                 alias /home/$1/public_html$2;
                 index  index.html index.htm;
                 autoindex on;
        }

        include /etc/nginx/conf/mythweb.include;
        #error_page  404              /404.html;
        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
                location = /50x.html {
            root   html;
        }

        location /transmission/ {

                proxy_pass_header X-Transmission-Session-Id;
                 proxy_set_header X-Forwarded-Host $host;
                 proxy_set_header X-Forwarded-Server $host;
                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                 proxy_pass  http://localhost:9091/transmission/;
        }
	}
}

and my mythweb.include is

location /mythweb/ {
   auth_basic               "MythWeb";
   auth_basic_user_file     mythweb.passwd;
   index /srv/http/mythweb/mythweb.php;
   try_files $uri @handler;
}
location ~ /mythweb/.+\.php {
   include         fastcgi_params;
   fastcgi_index   mythweb.php;
   fastcgi_split_path_info ^(.+\.php)(/?.+)$;
   fastcgi_param   SCRIPT_FILENAME  /srv/http$fastcgi_script_name;
   fastcgi_param   PATH_INFO $fastcgi_path_info;
   fastcgi_param   db_server localhost;
   fastcgi_param   db_name  mythconverg;
   fastcgi_param   db_login mythtv;
   fastcgi_param   db_password mythtv;
   fastcgi_param   hostname lith;
   fastcgi_pass    unix:/var/run/php-fpm/php-fpm.sock;
}

location @handler {
   rewrite /mythweb/(.+\.(php|pl))/.*      /mythweb/$1 last;
   rewrite /mythweb/(pl(/.*)?)$            /mythweb/mythweb.pl/$1 last;
   rewrite /mythweb/(.+)$                  /mythweb/mythweb.php/$1 last;
   rewrite /mythweb/(.*)$                  /mythweb/mythweb.php last;
}

The Mythweb .php files are in /srv/http/mythweb:

$ ll /srv/http/mythweb
total 96
drwxrwxr-x  2 root root  4096 Jan 27 02:36 php_sessions
drwxr-xr-x  2 root root  4096 Jan 27 02:36 includes
drwxrwxr-x  2 root root  4096 Jan 27 02:36 image_cache
drwxr-xr-x  2 root root  4096 Jan 27 02:36 configuration
drwxr-xr-x  5 root root  4096 Jan 27 02:36 classes
-rw-r--r--  1 root root  8696 Jan 27 02:36 README
-rw-r--r--  1 root root   188 Jan 27 02:36 LICENSE
-rw-r--r--  1 root root 12571 Jan 27 02:36 INSTALL
drwxr-xr-x  9 root root  4096 Jan 27 02:36 skins
-rwxr-xr-x  1 root root  2849 Jan 27 02:36 mythweb.pl
-rwxr-xr-x  1 root root  1197 Jan 27 02:36 mythweb.php
-rw-r--r--  1 root root  1578 Jan 27 02:36 mythweb.conf.lighttpd
-rw-r--r--  1 root root  9160 Jan 27 02:36 mythweb.conf.apache
drwxr-xr-x 17 root root  4096 Jan 27 02:36 modules
drwxr-xr-x  4 root root  4096 Jan 27 02:36 js
drwxr-xr-x 10 root root  4096 Jan 27 02:36 .
drwxr-xr-x  4 root root  4096 Mar 25 17:07 ..

Also:

$ ll /srv/http
total 68
drwxr-xr-x 10 root root  4096 Jan 27 02:36 mythweb
drwxr-xr-x  4 root root  4096 Feb 20 15:15 ..
-rw-rw-rw-  1 root root   167 Mar 12 23:10 index.html
-rw-r--r--  1 root root   113 Mar 25 17:07 index.php
drwxr-xr-x  4 root root  4096 Mar 25 17:07 .
drwxr-xr-x  2 root root  4096 Mar 25 17:07 scripts

ningix displays this in the access log when trying to get to lith/mythweb:

192.168.0.9 - user [25/Mar/2012:17:17:35 +0100] "GET /mythweb/ HTTP/1.1" 200 5 "-" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0"

and nothing in the error log. php-fpm display this after a restart:

[25-Mar-2012 16:54:29] NOTICE: Finishing ...
[25-Mar-2012 16:54:29] NOTICE: exiting, bye-bye!
[25-Mar-2012 16:54:29] NOTICE: configuration file /etc/php/php-fpm.conf test is successful

[25-Mar-2012 16:54:29] NOTICE: fpm is running, pid 10705
[25-Mar-2012 16:54:29] NOTICE: ready to handle connections

My php-fpm config is default apart from

php_admin_value[memory_limit] = 64M

it appears that nothing is connecting to php-fpm- could this the problem? If so how do I make nginx connect. Thanks for any help.

Offline

Board footer

Powered by FluxBB