いつもお世話になっております。
phpMyAdminについて質問させて下さい。
nginx の場合のphpmyadminの設定
http://ドメイン/phpMyAdmin/でブラウザ表示すると
403 Forbidden
nginx/1.0.15
と表示されてしまいます。
allowのIPアドレスに現在のブラウザIPを入れる必要があるかなと思い設定したのですが、設定が間違っているのか未だ正常に表示されません。
分かる方がいらっしゃいましたら教えて頂きますと幸いです。
■環境
sakura vps 2core
centos6
nginx
php5-fpm
phpMyAdmin
インストール済み
データベース作成済み
nginxのファイル移動等はしておりません。
default.conf
# # The default server # server { listen 80 default_server; server_name ドメイン設定済み; #charset koi8-r; #access_log logs/host.access.log main; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { root /var/www/01/wp; index index.php; if (!-e $request_filename) { rewrite ^/(.+)$ /index.php?q=$1 last; break; } } # phpmyadmin setting location /phpMyAdmin { alias /usr/share/phpMyAdmin/; try_files $uri $uri/ /index.php; location ~ ^/phpMyAdmin/(.+\.php)$ { alias /usr/share/phpMyAdmin; fastcgi_pass unix:/var/run/php-fpm/php5-fpm.socket; fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin/$1; include fastcgi_params; fastcgi_intercept_errors on; allow 許可するIPアドレス; deny all; } } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass unix:/var/run/php-fpm/php5-fpm.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/01/wp/$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
phpMyAdmin.conf
# phpMyAdmin - Web based MySQL browser written in php # # Allows only localhost by default # # But allowing phpMyAdmin to anyone other than localhost should be considered # dangerous unless properly secured by SSL Alias /phpMyAdmin /usr/share/phpMyAdmin Alias /phpmyadmin /usr/share/phpMyAdmin <Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require ip 127.0.0.1 Require ip ::1 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory> <Directory /usr/share/phpMyAdmin/setup/> <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require ip 127.0.0.1 Require ip ::1 </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory> # These directories do not require access over HTTP - taken from the original # phpMyAdmin upstream tarball # <Directory /usr/share/phpMyAdmin/libraries/> Order Deny,Allow Deny from All Allow from None </Directory> <Directory /usr/share/phpMyAdmin/setup/lib/> Order Deny,Allow Deny from All Allow from None </Directory> <Directory /usr/share/phpMyAdmin/setup/frames/> Order Deny,Allow Deny from All Allow from None </Directory> # This configuration prevents mod_security at phpMyAdmin directories from # filtering SQL etc. This may break your mod_security implementation. # #<IfModule mod_security.c> # <Directory /usr/share/phpMyAdmin/> # SecRuleInheritance Off # </Directory> #</IfModule>
phpMyAdminはデフォルト設定です。
こちらをいじればいのかと思うのですが、
どの様に記述すれば表示されますでしょうか。
ドメイン名/phpmyadmin/で表示させるつもりです。
お分かりになる方いらっしゃいましたら何卒宜しくお願い致します。
【追記 nginxのエラーログ】
2016/04/20 00:21:57 [error] 26801#0: *68 directory index of "/usr/share/phpMyAdmin//" is forbidden, client: IPアドレス, server: ドメイン, request: "GET /phpMyAdmin/ HTTP/1.1", host: "ドメイン"
この様に表示されております。