보안을 위해서 대부분 웹서버와 DB 서버를 분리합니다.
DB서버의 경우 웹서버에서만 접속을 허용하고 이외에는 다 차단합니다.
이전 글을 참고해주세요.
2020/12/12 - [Web/Server] - [서버 구축] Ubuntu + Nginx + MariaDB + Laravel 설치하기 - (4)
2020/12/12 - [Web/Server] - [서버 구축] Ubuntu + Nginx + MariaDB + Laravel 설치하기 - (3)
[서버 구축] Ubuntu + Nginx + MariaDB + Laravel 설치하기 - (3)
이전 글 이어서 진행하도록 하겠습니다. 설치 명령어: $ sudo apt install -y php-mbstring php-xml php-fpm php-zip php-common php-fpm php-cli unzip curl nginx nginx와 php 라이브러리들을 다운로드하여줍시..
parase.tistory.com
pma.conf로 DB서버에 생성해주세요.
server {
listen 443 ssl http2 default_server;
server_name 172.30.1.4;
ssl on;
ssl_certificate /etc/nginx/ssl/cacert.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
location / {
root /usr/share/phpmyadmin;
index index.html index.php;
}
location ~ \.php$ {
root html;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin/$fastcgi_script_name;
include fastcgi_params;
}
}
DB서버에
vi /etc/hosts.allow
ALL:192.168.56.102 (클라우드에서 할때는 외부아이피)
vi /etc/hosts.deny
ALL:ALL
'Web > Database' 카테고리의 다른 글
[SQL] 외래키 설정하기 (0) | 2021.04.16 |
---|---|
[SQL] auto_increment = 1 로 다시 설정하기 (0) | 2021.04.05 |
[MySQL][phpMyAdmin]root 로그인 (0) | 2021.01.11 |
최근댓글