๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ96

[Linux] ๋ฐฉํ™”๋ฒฝ ์„ค์ •ํ•˜๊ธฐ / ํŠน์ • ํฌํŠธ ๋ฐฉํ™”๋ฒฝ ์˜คํ”ˆ CentOS6 ๊นŒ์ง€๋Š” ๋ฐฉํ™”๋ฒฝ ์„ค์ •์„ ํ•˜๊ธฐ ์œ„ํ•ด์„  iptables์„œ๋น„์Šค๋ฅผ ์žฌ์‹œ์ž‘ํ•˜์—ฌ ๋ฐฉํ™”๋ฒฝ ๊ทœ์น™์„ ์„ค์ •ํ•˜์˜€๊ณ , CentOS7 ๋ถ€ํ„ฐ๋Š” ๋ฐฉํ™”๋ฒฝ์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ๋ชฌ์ธ firewalld๊ฐ€ ์ œ๊ณต๋˜์–ด ๋ณด๋‹ค ์‰ฝ๊ฒŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ณธ ํฌ์ŠคํŒ…์—์„  firewalld์— ๋Œ€ํ•ด ์„ค๋ช…ํ•˜๊ณ ์ž ํ•œ๋‹ค! ๋ฆฌ๋ˆ…์Šค OS ๋ฒ„์ „ ํ™•์ธ ๋ฐฉ๋ฒ• cat /etc/*release* firewalld ์„ค์น˜ yum install firewalld systemctl start firewalld systemctl enable firewalld ๊ธฐ๋ณธ ์„ค์ •์€ /usr/lib/firewalld/์— ์œ„์น˜ํ•˜๊ณ  ์žˆ๋‹ค. ์—ฌ๊ธฐ์„œ zone๊ณผ zone๋ณ„ ํ—ˆ์šฉํ•˜๋Š” ์„œ๋น„์Šค๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์‹œ์Šคํ…œ ๊ฐœ๋ณ„ ์„ค์ •์€ /etc/firewalld/์— ์œ„์น˜ํ•˜๊ณ  ์žˆ์œผ๋ฉฐ firewalld.conf.. 2021. 12. 22.
[Log] ๋กœ๊ทธ ํŒŒ์ผ ๋ถ„๋ฆฌํ•˜๊ธฐ - Log4j, Logback ํ”„๋กœ์ ํŠธ ์ง„ํ–‰ ๋„์ค‘ ํŠน์ • ์„œ๋น„์Šค๋งŒ ๋กœ๊ทธ ํŒŒ์ผ์„ ๋ถ„๋ฆฌํ•ด์„œ ์ €์žฅํ•ด์•ผ๋  ์ผ์ด ์žˆ์–ด ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆ˜์ •ํ•˜์˜€๋‹ค. ์ˆ˜์ • ์ „ org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BasicService.class.getName()); logger.info("๋กœ๊ทธ ๋‚ด์šฉ"); ์ˆ˜์ • ํ›„ org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BasicService.class.getName()); org.slf4j.Logger regLogger = org.slf4j.LoggerFactory.getLogger("RegLogger"); logger.info("๋กœ๊ทธ ๋‚ด์šฉ"); regLogger.info("๋กœ๊ทธ ๋‚ด์šฉ"); ๋ถ„๋ฆฌํ•ด.. 2021. 12. 22.
[JAVA] ๋‚ ์งœ ๋น„๊ต ํ•˜๊ธฐ (Date, LocalDateTime, LocalDate) 1. java.util.Date์—๋Š” ๋‚ ์งœ๋ฅผ ๋น„๊ตํ•  ์ˆ˜ ์žˆ๋Š” ๋ฉ”์†Œ๋“œ๊ฐ€ ๋‘๊ฐ€์ง€ ์žˆ๋‹ค. after, before ์‚ฌ์šฉ - before: ์ธ์ž๋ณด๋‹ค ๊ณผ๊ฑฐ์ผ ๋•Œ true - after: ์ธ์ž๋ณด๋‹ค ๋ฏธ๋ž˜์ผ ๋•Œ true - equal: ์ธ์ž์™€ ๊ฐ™์„ ๋•Œ true public void compareDate(Date date1, Date date2){ if(date1.after(date2)){ System.out.println("Date1 > Date2"); } if(date1.before(date2)){ System.out.println("Date1 < Date2"); } if(date1.equals(date2)){ System.out.println("Date1 = Date2"); } } compareTo ์‚ฌ์šฉ - comp.. 2021. 12. 21.
[Log4j2 ์ทจ์•ฝ์  ์ด์Šˆ] spring boot ๋‚ด์žฅ๋œ Log4j2 ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „ ๋ณ€๊ฒฝํ•˜๊ธฐ (maven, gradle) ์ง€๋‚œ์ฃผ ์ฃผ๋ง์— log4j2 ์ทจ์•ฝ์  ์ด์Šˆ๊ฐ€ ์žˆ์—ˆ๋‹ค. ๋‹คํ–‰ํžˆ ์šฐ๋ฆฌ ํ”„๋กœ์ ํŠธ์—์„  ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š” log4j2-core๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€ ์•Š์•˜์ง€๋งŒ log4j2-api, log4j-to-slf4์™€ ๊ฐ™์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋„ ์ตœ์‹ ํ™”ํ•˜๊ณ ์ž ํ–ˆ๋‹ค. Spring Boot ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ๋‚ด์žฅ๋œ log4j2๋ฅผ ์‚ฌ์šฉ ์ค‘์ด์˜€๊ณ , ๋จผ์ € Spring Boot์˜ ๋ฒ„์ „์„ ๊ฐ€์žฅ ์ตœ์‹  ๋ฒ„์ „์ธ 2.6.1๋กœ ๋ณ€๊ฒฝํ•˜์˜€๋‹ค. ํ•˜์ง€๋งŒ 2.6.1 ๋ฒ„์ „์— ๋‚ด์žฅ๋œ log4j2์˜ ๋ฒ„์ „์€ 2.14.1์ด์˜€๊ณ .. ๋‚ด์žฅ๋œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ๋ฒ„์ „์„ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ฐพ์•„ ํ•ด๊ฒฐํ•˜์˜€๋‹ค! ๋ฐฉ๋ฒ•1 2.17.0์ธ log4j-api, log4j-to-slf4j๋ฅผ ์„ ์–ธํ•ด์ฃผ๋ฉด spring boot์— ๋‚ด์žฅ๋œ log4j์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฒ„์ „์ด ๋ณ€๊ฒฝ๋œ๋‹ค. gradle implementation group: '.. 2021. 12. 17.
[Linux] MySQL DB ๋ฐฑ์—… ์Šคํฌ๋ฆฝํŠธ - ์ž๋™์œผ๋กœ ๋ฐฑ์—…ํ•˜๊ธฐ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ž๋™์œผ๋กœ ๋ฐฑ์—…ํ•  ์ˆ˜ ์žˆ๋„๋ก ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž‘์„ฑํ–ˆ๋‹ค. #! /bin/bash # backup directory dir=$(echo /home1/test01/project01/db/backup) # get backup file time and now time customer_BackupFileDate=$(date -r $dir/backup_customer.sql '+%Y-%m-%d %H:%M:%S') customer_BackupFileDateString=$(date -r $dir/backup_customer.sql '+%Y%m%d_%H%M%S') # rename last backup file mv $dir/backup_customer.sql $dir/backup_customer_$cust.. 2021. 12. 17.
[Linux] ๋ฆฌ๋ˆ…์Šค์—์„œ Unix ODBC ์‚ฌ์šฉํ•˜๊ธฐ 1. ๋จผ์ € Unix ODBC๋ฅผ ์„ค์น˜ํ•œ๋‹ค. yum install -y unixODBC-devel ์„ค์น˜ํ•˜๋ฉด .odbc.ini ํŒŒ์ผ์ด ์ƒ์„ฑ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค! .odbic.iniํŒŒ์ผ์„ ์ž‘์„ฑํ•˜๊ธฐ์— ์•ž์„œ mysql db์— ์—ฐ๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด mysql connector๋ฅผ ์„ค์น˜ํ–ˆ๋‹ค. yum install -y mysql-connector-odbc 2. .odbc.ini ์ž‘์„ฑ [db_test] Description = MySQL ODBC 3.51 Driver Driver = /home/test/sw/mariadb-connector-odbc-2.0.15-ga-rhel6-x86_64/lib64/libmaodbc.so Server = x.x.x.x Socket = User = test Password = test Port.. 2021. 12. 16.
[Spring Framework] CSRF ์ ์šฉ ์ง€๋‚œ ๋ฒˆ์— spring boot์— csrf๋ฅผ ์ ์šฉํ•˜๋Š” ํฌ์ŠคํŒ…์„ ์˜ฌ๋ ธ์—ˆ๋Š”๋ฐ ๊ทธ๋ƒฅ spring๊ณผ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ๋‹ฌ๋ผ ๋˜ ํฌ์ŠคํŒ…์„ ์˜ฌ๋ ค๋ณธ๋‹ค! [Spring Boot] spring security - CSRF ์ ์šฉ , +) ajax csrf ์ ์šฉ 1. gradle ํ˜น์€ maven์— 'spring-boot-starter-security' ์ถ”๊ฐ€ implementation 'org.springframework.boot:spring-boot-starter-security' org.springframework.boot spring-boot-starter-security 2.5.5 Spring S.. ynzu-dev.tistory.com web.xml์— dispactcher servlet์„ ๋“ฑ๋กํ•œ๋‹ค. appServlet.. 2021. 12. 14.
ํ•˜๋‚˜์˜ tomcat์— ๊ฐ™์€ ํ”„๋กœ์ ํŠธ ๋‘๊ฐœ ์ด์ƒ ๋„์šฐ๊ธฐ : 'webapp.root' ์—๋Ÿฌ ํ•˜๋‚˜์˜ ํ†ฐ์บฃ์— ๊ฐ™์€ ํ”„๋กœ์ ํŠธ๋ฅผ ๋‘๊ฐœ ์ด์ƒ ๋„์—ˆ์„ ๋•Œ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์‹ฌ๊ฐ: Exception sending context initialized event to listener instance of class ch.qos.logback.ext.spring.web.LogbackConfigListener java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' log4j์˜ default value๊ฐ€ webapp.root๋ผ ๋”ฐ๋กœ ์ง€์ •ํ•ด์ฃผ์ง€ ์•Š๋Š”๋‹ค๋ฉด ์ค‘๋ณต๋œ๋‹ค. ํ•ด๊ฒฐ๋ฐฉ๋ฒ•์€ ๊ฐ„๋‹จํ•œ๋‹ค! web.xml์— ์•„๋ž˜์™€ ๊ฐ™์ด ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋! param-value๋ฅผ ์ง€์ •ํ•ด์ฃผ๋ฉด ๋œ๋‹ค webAppR.. 2021. 12. 13.
728x90
๋ฐ˜์‘ํ˜•