I
I
Igor Gorgul2014-09-12 12:32:38
PHP
Igor Gorgul, 2014-09-12 12:32:38

How to setup apache mpm-itk + nginx, nginx+php-fpm?

There are three users ab, ab1, ab. Each user has their own home directory at /var/www/ab[1,2]. Sites are located in /var/www/ab[1,2]/www/domen. Users ab and ab2 should have apache+nginx bundle, and user ab1 should have nginx+php-fpm. Problems:
1) I have no problems setting up nginx+php-fpm (ab1), except that joomla is installed there and saves the configuration file not in /var/www/ab1/www/domen , but in /var/www/ab1, then is in the root of the user's home directory. phpMyAdmin works correctly at domain/phpmyadmin.
2) Now to the apache mpm-itk + nginx bundle. No static is given to phpmyadmin, there is such an error in the apache logs

phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php. Check group www-data has read access., referer: http://ab.hotcluster.com/phpmyadmin/index.php?token=4ea7e5c681fd66cb63d0eb580e49c1d3

What rights and what owner should be set in these folders?
r[email protected]:/etc/php5/fpm# ls -l /etc/phpmyadmin
total 40
-rw-r--r-- 1 root root     1167 Sep 11 00:37 apache.conf
-rw-r----- 1 root www-data  543 Sep 10 12:45 config-db.php
-rw-r--r-- 1 root root      168 Mar 28  2012 config.footer.inc.php
-rw-r--r-- 1 root root      168 Mar 28  2012 config.header.inc.php
-rw-r--r-- 1 root root     4388 Mar 28  2012 config.inc.php
-rw-r----- 1 root www-data    8 Sep  9 11:45 htpasswd.setup
-rw-r--r-- 1 root root      570 Mar 28  2012 lighttpd.conf
-rw-r--r-- 1 root root      198 Mar 28  2012 phpmyadmin.desktop
-rw-r--r-- 1 root root      295 Mar 28  2012 phpmyadmin.service

When I visit the ab site, chrome says a circular redirect is detected. In nginx logs
2 stat() "/var/www/ab/www/ab/" failed (13: Permission denied), client: 123.123.123.123, server: ab, request: "GET / HTTP/1.1", host: "ab"

The apache log is empty. I know that the problem is in the rights and groups, but I can not figure it out.
apache and nginx configs
<VirtualHost *:8080>

ServerName ab
ServerAlias www.ab

DocumentRoot /var/www/ab/www/ab

ErrorLog /var/www/ab/logs/error_log
CustomLog /var/www/ab/logs/access_log combined

AssignUserId ab ab

<Directory />
  #Order Deny,Allow
  #Deny from all
  Options -ExecCGI -Indexes -Includes +FollowSymLinks
  AllowOverride All

    php_admin_value open_basedir "/var/www/ab/:."
    php_admin_value upload_tmp_dir "/var/www/ab/tmp"
    php_admin_value session.save_path "/var/www/ab/tmp"
</Directory>
</VirtualHost>

server {
        listen   80;
        server_name ab www.ab;

        root /var/www/ab/www/ab;
        index index.html index.php;

        access_log /var/www/ab/logs/ab.access_log;
        error_log /var/www/ab/logs/ab.error_log;

        location / {
        try_files $uri $uri/ /index.php;
        }

        location ~ \.php$ {        
        proxy_set_header X-Real-IP  $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8080;
        }

        location ~ /\.ht {
            deny all;
        }

        location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                        proxy_pass http://127.0.0.1:8080;
                        include /etc/nginx/proxy_params;
               }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }        
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evgenyks, 2015-05-08
@evgenyks

When installing nginx on top of apache2-mpm-itk, I came across ...
Maybe it will help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question