reynierpm at gmail.com
2014-Oct-29 19:24 UTC
[CentOS] Right way to install phpMyAdmin through Nginx and PHP-FPM
First I know this is not a list for PHP or Nginx setup or something else
but I'll give it a try and ask here for support I'm running a new server
with PHP 5.5.18 and Nginx 1.6.2 through FPM/FastCGI. The server is working
fine since I have other websites running on it. Now I'm trying to configure
phpMyAdmin and I tried this:
* 1. *Create a file under `/etc/nginx/sites-available/phpMyAdmin with this
content:
server {
server_name phpmyadmin.dev pma;
root /usr/share/phpMyAdmin;
location / {
index index.php;
}
## Images and static content is treated different
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 360d;
}
location ~ /\.ht {
deny all;
}
location ~ /(libraries|setup/frames|setup/libs) {
deny all;
return 404;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
}
access_log /var/log/nginx/phpmyadmin/access.log;
error_log /var/log/nginx/phpmyadmin/error.log;
}
But any time I restart Nginx service I got this error:
nginx: [emerg] unknown "root" variable
nginx: configuration file /etc/nginx/nginx.conf test failed
* 2. *Create a symbolic link in `/var/www/html` to the route where
phpMyAdmin was installed `/usr/share/phpMyAdmin` by running `ln -s
/usr/share/phpMyAdmin/ /var/www/html` that way Nginx start fine but when I
go to `http://devserver/phpMyAdmin` I got `Access denied.`
What I'm doing wrong? What is the right way to configure the server in
order to serve phpMyAdmin as any other site?
Alexei Altuhov
2014-Oct-30 00:35 UTC
[CentOS] Right way to install phpMyAdmin through Nginx and PHP-FPM
If SElinux is in enforcing mode, check /var/log/audit/audit.log for messages with "denied" to nginx trying accessing your pma path. Or altermatevely you could run audit2why -brvw, provided you have installed the required rpm the above command is part of beforehand. (Smth like python-policy-blah. Can't tell from the top of my head) On Oct 29, 2014 9:25 PM, "reynierpm at gmail.com" <reynierpm at gmail.com> wrote:> First I know this is not a list for PHP or Nginx setup or something else > but I'll give it a try and ask here for support I'm running a new server > with PHP 5.5.18 and Nginx 1.6.2 through FPM/FastCGI. The server is working > fine since I have other websites running on it. Now I'm trying to configure > phpMyAdmin and I tried this: > > * 1. *Create a file under `/etc/nginx/sites-available/phpMyAdmin with this > content: > > server { > server_name phpmyadmin.dev pma; > root /usr/share/phpMyAdmin; > > location / { > index index.php; > } > > ## Images and static content is treated different > location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { > access_log off; > expires 360d; > } > > location ~ /\.ht { > deny all; > } > > location ~ /(libraries|setup/frames|setup/libs) { > deny all; > return 404; > } > > location ~ \.php$ { > include /etc/nginx/fastcgi_params; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; > } > > access_log /var/log/nginx/phpmyadmin/access.log; > error_log /var/log/nginx/phpmyadmin/error.log; > } > But any time I restart Nginx service I got this error: > > nginx: [emerg] unknown "root" variable > nginx: configuration file /etc/nginx/nginx.conf test failed > > * 2. *Create a symbolic link in `/var/www/html` to the route where > phpMyAdmin was installed `/usr/share/phpMyAdmin` by running `ln -s > /usr/share/phpMyAdmin/ /var/www/html` that way Nginx start fine but when I > go to `http://devserver/phpMyAdmin` I got `Access denied.` > > What I'm doing wrong? What is the right way to configure the server in > order to serve phpMyAdmin as any other site? > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >
Alexei Altuhov
2014-Oct-30 00:38 UTC
[CentOS] Right way to install phpMyAdmin through Nginx and PHP-FPM
Dear list members, sorry for top posting. Couldn't find a respective setting on gmail mobile client at 2AM
John Doe
2014-Oct-30 10:06 UTC
[CentOS] Right way to install phpMyAdmin through Nginx and PHP-FPM
From: "reynierpm at gmail.com" <reynierpm at gmail.com>> location ~ \.php$ { > include /etc/nginx/fastcgi_params; > fastcgi_pass 127.0.0.1:9000; > fastcgi_index index.php; > fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; > } > ... > nginx: [emerg] unknown "root" variable > nginx: configuration file /etc/nginx/nginx.conf test failedMaybe you meant to use '$document_root' ... JD