본인의 OS : centos 6.X 설치 ### 필수 패키지 설치 ### # yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` iptables-devel ### perl-Text-CSV_XS 설치 (2가지) ### 1) 직접 rpm으로 설치하는 방법 http://pkgs.repoforge.org/perl-Text-CSV_XS/ 에서 최신 버전을 확인하고 설치해준다. # rpm -Uvh http://pkgs.repoforge.org/perl-Text-CSV_XS/perl-Text-CSV_XS-0.80-1.el6.rf.x86_64.rpm 2) rpmforge repo 를 추가하여 yum으로 설치하는 방법 # rpm -i ht..
DNS 서버의 잘못된 설정을 이용한 분산 반사 서비스 거부 공격 (DRDoS 공격)의 형태인증 절차가 존재 하지 않는 DNS 서버의 경우 Reflector로 사용되어 공격에 사용될 수 있습니다. 방법(vi /etc/named.conf) recursion no;additional-from-auth no; additional-from-cache no;Then restart named so that it will use the new secure options:/etc/init.d/named restart
메이븐 의존 라이브러리 주입 javax.validation validation-api 1.1.0.Final org.hibernate hibernate-validator 5.2.2.Final org.hibernate hibernate-validator-annotation-processor 5.2.2.Final @Valid를 사용하기 위하여 스프링 컨테이너에 빈 등록 모델클래스에 어노테이션 기반의 검증 코드 작성 컨트롤러단에 적용@ModelAttribute 로 받은 모델 객체가 @Valid 적용이 되어 있다면 수행BindingResult 타입으로 성공 실패 여부 판단
몇일전에 디도스 공격을 당해서 클라우드 호스팅중인 업체에서 하룻동안 서버를 정지시켰다. 공부겸 사이트를 만드는 것이라 누가 접속할 것이라고는 생각도 못했다. 그래서 톰캣에 로그를 남기고 비정상적으로 많은 접속을 하는 아이피를 차단하기 위해 톰캣차원에서 로그를 남기기로 했다. centos 기준...톰캣에 로그기록을 남기기 위한 설정은 다음과 같다./etc/tomcat6/server.xml 파일 내용 중 아래 부분(Valve엘리먼트)의 주석을 제거한 후 Tomcat을 재시작하면 된다. (초기에는 주석처리가 되어있다.) 아래와 같이 수정했다.(아래의 엘리먼트가 위치할 곳은 Engine엘리먼트 내부이다.) 참조: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.ht..
File newFile = new File(path, fileName); if(!newFile.exists()){ newFile.mkdirs(); newFile.createNewFile(); } 리눅스에서는 파일에 생성에 대한 기본권한이 644 이다. (폴더의 기본 권한은 755) umask 라는 커맨드에서 초기값이 022로 되어있는데..이것을 토대로 폴더(디렉토리)는 777-022 = 755파일은 666-022 = 644파일이 666인 이유는 etc쪽의 설정파일에서 설정 값을 잡고 있는 듯 하다. 644란100의 자리 숫자인 6은 root사용자의 권한을 나타내고10의 자리 숫자인 4는 그룹에 속한 사용자를 나타낸다.그리고 1의 자리 숫자인 4는 그 외의 사용자를 지칭한다. 파일이나 폴더에 대한 허가권으..
cnetos를 사용중인데 사이트를 배포하고 접속해서 로그인을 해보니 처음엔 글자가 깨지더니 두번째로한글을 인서트하니 데이터베이스 에러를 내뿜었다. show create table 테이블이름;테이블의 정보를 보는 것으로 결과의 마지막에 charset이 라틴어로 되어있어서 한글을 처리하지 못한 것이다. 테이블을 생성할 때 디폴트 캐릭터셋을 설정하기 위해서는 다음 경로의 파일을 수정한다.# vi /etc/my.cnf 파일을 열었으면 아래와 같이 수정한다.[client]default-character-set = utf8 [mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recomm..
1. 우선 구글 계정 가입을 한다. 2. https://www.google.com/settings/u/1/security/lesssecureapps 이곳에 가서 보안 수준을 사용으로 한다. 3. spring에서 메일 관련 라이브러리를 pom.xml에 의존성 주입 - javax.mail mail - org.springframework.integration spring-integration-mail 4. 스프링 컨테이너인 root-context.xml에 관련 빈을 정의한다. helpMailSendableJavaMailSenderImpl을 주입받고 실제로 메일을 보내는 일을 담당하는 사용자 정의 인터페이스 JavaMailSenderImpl메일을 보내기 위하여 여러가지 값을 설정, 제공하는 인스턴스 smtp.g..
테이블에 새로운 칼럼 추가 alter table 테이블명 add column 추가칼럼명 타입선언 not null; 테이블의 칼럼타입 변경 alter table 테이블명 modify column 칼럼명 변경할타입선언 ; 테이블의 칼럼이름 변경 alter table 테이블명 change column 기존칼럼명 변경칼럼명 타입; 테이블 칼럼 삭제 alter table 테이블명 drop column 칼럼명; 칼럼에 인덱스 선언 alter table 테이블명 add index 부여하고싶은인덱스명( 칼럼명1, 칼럼명2, ........ ); 칼럼 인덱스 삭제 alter table 테이블명 drop index 인덱스명; 테이블명 변경 alter table 원본 테이블명 rename 새로운 테이블명; 테이블 엔진 및 ..
먼저 yum 패키키 설치 명령어로 svn 패키지를 설치합니다.# yum -y install subversion 저장소로 사용할 디렉토리를 생성합니다. (저는 root경로에 web디렉토리를 저장소로 하겠습니다.) # mkdir /svn# cd /svn# svnadmin create 만들저장소명저장소를 위치시킬 디렉토리를 하나 만들고, 만든 디렉토리로 이동 후 svnadmin 명령으로 저장소를 만듭니다. 이제 /svn/저장소명 경로에 svn에 설정 폴더들이 생기게 됩니다.그중에서 conf디렉토리에 있는 svnserve.conf 파일을 vi로 열어서 다음항목의 주석을 해제합니다,anon-access=readauth-access=writepassword-db=passwd여기서 중요한 부분은 각 항목의 앞부분에 ..
clone()은 최고 조상인 Object클래스에 정의된 멤버이다. 이것이 하는 일은 생성된 객체와 똑같은 값을 가지고 있는 복사본의 인스턴스를 생성하는 일을한다.변경되기 전의 값을 참고해야할 때 또는 원래의 값으로 돌려 넣고 싶을 때 이용하면 도움이 될 것이다. 이 clone()를 객체를 상대로 사용하기 위해서는 해당 객체에 Cloneable이라고 하는 인터페이스 구현체를 implements 해줘야한다.그리고 해당 clone()를 오버라이딩 해 해당 객체를 복사하는 코드를 기술해야 한다. clone()은 구현되는 사용자 클래스의 객체멤버에 대한 완전한 값복사를 지원하지 않는다. 참조복사라고하고 얕은복사라고도 하는 주소복사가 이뤄지기 때문에 복사본의 객체에 참조형 멤버변수가 존재한다면 그 값의 변경이 원본..
tomcat을 yum 패키지를 이용해서 설치 하였으며. tomcat의 기본 위치는 /usr/share/ 경로에 있다. 아래는 tomcat의 server.xml 파일의 내용 server.xml을 살펴보면 host엘리먼트에 appBase속성이 tomcat의 진입점을 나타낸다 설정을 안했을 때는 기본경로로 webapps 를 잡고있다. 기본적으로는 위처럼 명시 되어있으며, 실제경로는 catalina_home변수/webapps/ROOT를 가리킨다. 이제 톰캣의 기본 진입 경로인 root경로를 바꾸기 위해서는 host엘리먼트의 속성인 appBase의 경로를 변경하고 이를 적용시키기 위해서 Context엘리먼트를 host엘리먼트 내에 위치시킨다. 변경된 server.xml이 위에 보이는것이다. Context엘리먼트의..
class Program { static void Main(string[] args) { Korean k = null; k = k ?? new Korean("cnsdl"); Console.WriteLine(k); } } class Korean { public string name { get; set; } public Korean(string name) { this.name = name; } public override string ToString() { return this.name; } } ?? 키워드 마치 삼항 연산자와 비슷한(같은건 아님) 성질을 지니고 있습니다. 단지 ?? 키워드는 그 대상을 기본타입이 아닌 객체의 변수를 대상으로 한정짓고 있습니다. 코드를 보시면 Korean이라는 객체를 초기에 ..
{{ x }} ng-repeat지시자는 html 엘리먼트를 반복하는 반복문 개념이다.예제에서 names배열데이터를 가져와서li엘리먼트에 ng-repeat지시자를 사용해서 출력해주고 있다. {{ x.name + ', ' + x.country }} ng-repeat에 대한 소스지만 객체 데이터 배열을 대상으로 사용하는 법을 알려주고 있다. AngularJS Filters필터명설명 filter포함되는 정보만을 찾아준다 필터링..lowercase영문일 경우 대문자를 소문자로 변경해준다.orderBy배열을 정렬uppercase영문일 경우 소문자를 대문자로 변경해준다. The name is {{ name | uppercase }} 위 예제는 ng-model="name"의 입력이 모두 대문자로 입력이된다. Filte..