Forum: NGINX Configuring phpmyadmin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F7ec36678a4102de7a6895d299a60819?d=identicon&s=25 Ian Hobson (Guest)
on 2009-01-30 18:15
(Received via mailing list)
Hi All,

I've been round and round this problem for days now - and I still can't
get it sorted.

I'm using Unbuntu LTS, and phpmyadmin - standard installs.

So far I have a file visible in /etc/nginx/sites-available that
contains:-
#  server for phpmyadmin
server {
    listen 80;
    server_name phpmyadmin.xxxxxxxxx.com;

    location /phpmyadmin {
      root /usr/share;
      index index.php;
   }

   location ~ \.php$ {
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
   }
}

This serves the log-on screen, from url /phpmyadmin/index.php , and
includes the logo (from  <img src="./themes/original/img/logo_right.png"
id="imLogo"..   However, whatever I enter into the log-on boxes, I get
the log-on screen back - without any error messages. I have to conclude
that fastcgi is not recognising the post or it would say invalid
user/password.

The <form line is ....

<form method="post" action="index.php" target="_parent">

1) How can I  get the URI  /phpmyadmin to serve  /phpmyadmin/index.php
?

2) How to get the post passed back to the CGI script.

The fastcgi_params file is included at the http level, and contains....

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
# may be over-ridden at location level.
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;

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

Regards

Ian
96dfd0f0a8399d3b03feba1e6a562e0a?d=identicon&s=25 Edho P Arief (Guest)
on 2009-01-30 18:30
(Received via mailing list)
On Sat, Jan 31, 2009 at 12:05 AM, Ian Hobson <ian@ianhobson.co.uk>
wrote:
>   listen 80;
>     fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
>
> fastcgi_param  QUERY_STRING       $query_string;
> fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
> fastcgi_param  REDIRECT_STATUS    200;
>
> Regards
>
> Ian
>
>
>

have you properly configured phpmyadmin?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-01-30 23:17
(Received via mailing list)
On Fri, Jan 30, 2009 at 05:05:09PM +0000, Ian Hobson wrote:

>    listen 80;
>      fastcgi_param SCRIPT_FILENAME /usr/share$fastcgi_script_name;
> The <form line is ....
>
> <form method="post" action="index.php" target="_parent">
>
> 1) How can I  get the URI  /phpmyadmin to serve  /phpmyadmin/index.php  ?
>
> 2) How to get the post passed back to the CGI script.
>
> The fastcgi_params file is included at the http level, and contains....

You have to include them inside "location ~ \.php$" as single
fastcgi_param discard all inherited fastcgi_param's. This is why
PHP can not see POSTed body. Your location should be as

   location ~ \.php$ {
      fastcgi_pass 127.0.0.1:9000;
      root /usr/share;
      include  fastcgi_params;
   }

or as

http {

   include  fastcgi_params;

   location ~ \.php$ {
      fastcgi_pass 127.0.0.1:9000;
      root /usr/share;
   }
F7ec36678a4102de7a6895d299a60819?d=identicon&s=25 Ian Hobson (Guest)
on 2009-01-30 23:57
(Received via mailing list)
Thanks Igor.

Worked a charm :)

Igor Sysoev wrote:
>>
>> The fastcgi_params file is included at the http level, and contains....
>>
>
> You have to include them inside "location ~ \.php$" as single
> fastcgi_param discard all inherited fastcgi_param's. This is why
> PHP can not see POSTed body. Your location should be as
>
I was expecting the values to be inherited. No wonder things made no
sense.

To me, this feels wrong. CGI params and variables that are set at a
higher level should be inherited (but may be over-written) at lower
levels. Still, I'm sute there is a good reason.

Thanks again.

Ian
0f717d83872c6dd3771e55793eda991b?d=identicon&s=25 unknown (Guest)
on 2009-02-01 00:21
(Received via mailing list)
Hi everyone,

I'd like to know about the behavior the nginx does load balancing.

Let's say I have currently this situation

upstream phpfarm {

  server server1:8080 weight=10;
  server server2:8080 weight=10;
  server server3:8080 weight=10;

}

Does the nginx sequentially work down the list until it reaches the end
and starts again from the beginning? We had some not-so-round balancing
peaks with this where some host sometimes got noticeable more hits then
the others.

My idea is to make it more even doing it for example this way. Is there
something wrong with it?

upstream phpfarm {

  server server1:8080 weight=5;
  server server2:8080 weight=5;
  server server3:8080 weight=5;
  server server1:8080 weight=5;
  server server2:8080 weight=5;
  server server3:8080 weight=5;

}

I am currently testing it by myself. Any ideas, thoughts or experiences?

Best regards,

Emil Krueper
This topic is locked and can not be replied to.