Nginx 환경에서 https로 phpMyadmin 접속방법 설정

# yum install php-mbstring

# yum install epel-release
# yum install phpmyadmin
권한주기

# chgrp -R nginx /etc/phpMyAdmin

phpmyadmin 수동설치시 권한

권한 안주면 Nginx 403 Forbidden Error발생함.
chgrp -R nginx /usr/share/phpMyAdmin
chmod 755 /usr/share/phpMyAdmin
chmod 777 /usr/share/phpMyAdmin/tmp
chown -R nginx:nginx /usr/share/phpMyAdmin

# mkdir -p /etc/nginx/snippets
# vi /etc/nginx/snippets/phpMyAdmin.conf *nginx conf 폴더(snippets)임의로 폴저 생성해도 상관없음 .

아래. phpMyAdmin.conf 에 붙여넣기

location /phpMyAdmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpMyAdmin/(.+.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpMyAdmin/(.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpmyadmin {
rewrite ^/* /phpMyAdmin last;
}

nginx.conf page에 추가

include snippets/phpMyAdmin.conf;

http(s)://yc.co.kr/phpmyadmin 로 접속

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다