Backend Language/Ubuntu

Proxy Server ์—ฐ๊ฒฐ์€ ๋ณธ domain ํ˜น์€ ip์— ํ•˜์ง€ ์•Š๊ณ  Sub Domain์— ์—ฐ๊ฒฐํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ๋‹ค์Œ ์œ„์น˜์— Proxy Server Code๋ฅผ ์ž‘์„ฑํ•ด๋‘๋ฉด ๋œ๋‹ค. prod subDomain์— ์—ฐ๊ฒฐํ•ด ๋‘˜ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•œ๋‹ค. server { root /var/www/html/prod; index index.php index.html index.htm index.nginx-debian.html; server_name prod.๋„๋ฉ”์ธ์ด๋ฆ„.shop; location / { proxy_pass http://localhost:9000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_..
๊ฐ„๋‹จํ•˜๊ฒŒ ์„œ๋ฒ„ ๋ฐฐํฌ ๋ฐ ๋ฌด์ค‘๋‹จ ๋ฐฐํฌํ•œ ๊ฒƒ์„ ์ •๋ฆฌํ•ด๋ณด๊ณ ์ž ํ•œ๋‹ค. sudo su # update sudo apt update # nginx proxy server ์‚ฌ์šฉํ•  ์˜ˆ์ •์ด๊ธฐ ๋•Œ๋ฌธ์— nginx ๋‹ค์šด sudo apt install nginx # domain ์—ฐ๊ฒฐ ๋ฐ proxy server ์—ฐ๊ฒฐ # default ํŒŒ์ผ ๋ณ€๊ฒฝ vim /etc/nginx/sites-avaliable/default # default file ๋‚ด๋ถ€ server_name _; # ์ด๋ถ€๋ถ„์— ์›ํ•˜๋Š” ๋„๋ฉ”์ธ ์—ฐ๊ฒฐ location ~~{ # 404 ๋ญ์‹œ๊ธฐ ์ฃผ์„ ์ฒ˜๋ฆฌ proxy_pass http://localhost:8080; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwa..
com.mysql.cj.jdbc.exceptions.communicationsexception: communications link failure the last packet sent successfully to the server was 0 milliseconds ago. the driv er has not received any packets from the server. ์•ฑ ๋Ÿฐ์นญ์„ ์œ„ํ•ด ์„œ๋ฒ„๋ฅผ ๋ฐฐํฌํ•˜๋˜ ์™€์ค‘ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. Mysql์„ ์„ค์น˜ํ•˜์ง€ ์•Š๊ณ ์„œ๋„, ์ €๋ฒˆ์— ๋ฐฐํฌ๋ฅผ ์„ฑ๊ณตํ–ˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด์œ ๋ฅผ ์•Œ์ง€ ๋ชปํ•˜์˜€๋‹ค. Mysql์„ ๋‹ค์šด ๋ฐ›์•„๋ณด๊ณ , mysql์„ ๋‹ค์šด๋ฐ›์œผ๋‹ˆ localhost์— ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์ง€๋‚œ ๋ฐฐํฌ ๋•Œ์—๋Š” ๋”ฐ๋กœ mysql์„ ๋‹ค์šด ๋ฐ›์ง€ ์•Š๊ณ ๋„, ์œ„์™€ ๊ฐ™์€ ์—..
์„œ๋ฒ„์—์„œ ๋ฐฐํฌ๋ฅผ ํ•˜๊ฒŒ ๋˜๋ฉด redis๊ฐ€ ๋‹ค์šด์ด ๋˜์–ด ์žˆ์ง€ ์•Š์•„ ์—๋Ÿฌ ์ฝ”๋“œ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค. redis๋ฅผ ์ด์šฉํ•œ ๋กœ๊ทธ์•„์›ƒ์„ ๊ตฌํ˜„ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ubuntu server ํ™˜๊ฒฝ์—์„œ ๋‹ค์šด์„ ๋ฐ›์•„ ์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐํ•ด์ค˜์•ผ ํ•œ๋‹ค. sudo add-apt-repository ppa:redislabs/redis sudo apt-get update sudo apt-get install redis ์ดํ›„ redis์˜ port๊ฐ€ ์ž˜ ์‹คํ–‰๋˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•ด๋ณด๋ฉด apt install net-tools netstat -ntlp | grep 6379 ์ž˜ ์ผœ์ ธ ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋Ÿผ์—๋„ ์„œ๋ฒ„ ๋‚ด์˜ spring ํ”„๋กœ์ ํŠธ์—์„œ redis ์™€ ๊ด€๋ จ๋œ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค๋ฉด, spring project applicaiton.properties, or yml..
chaerlo127
'Backend Language/Ubuntu' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก