ssh key를 이용한 로그인

macOS 에서 ssh key를 지정하여 서버로 비밀번호 타이핑 없이 바로 로그인 하게 하자 평소엔 보안때문에 안해놓는다. macOS - 키 생성 1 ssh-keygen -t rsa -C "name" - public key를 조회 1 cat ~/.ssh/id_rsa.pub 대상 Server (CentOS) - public key를 ~/.ssh/authorized_keys 파일에 추가 1 vi ~/.ssh/authorized_keys

August 11, 2016 · 1 min · 페이퍼

AWS EC2서버에 패스워드로 로그인 하기

AWS ec2 서버에는 password로 ssh접근이 안되도록 되어 있다. 아래 파일을 수정하여 접근이 되도록 해보자. centos 6.5에서 작업한 것이다 1 2 # 루트계정에 패스워드 지정 passwd root 1 2 3 4 5 6 7 8 sudo vi /etc/ssh/sshd_config # 아래 두개 옵션을 yes로 하고 저장후 닫기 PermitRootLogin yes PasswordAuthentication yes # sshd 재시작 service sshd restart

April 8, 2016 · 1 min · 페이퍼

Flume의 기본 로그를 log4j에서 logback으로 변경

flume에 logback로 로그 파일 쓰기 flume에 logback 설치 방법 (http://logback.qos.ch/download.html) 에서 logback 다운로드 한다 . (현재 v1.1.3) 압축을 풀고. logback-classic-1.1.3.jar, logback-core-1.1.3.jar 를 $FLUME_HOME/lib에 복사해 넣는다. 기존 log4j는 ./lib/slf4j-log4j12-1.6.1.jar를 ./lib/slf4j-log4j12-1.6.1.jar.back로 이름을 바꾼다. log4j를 지우는 것은 선택사항이다 (놔두면 둘다 기록 한다) logback.xml 파일을 수정해서 $FLUME_HOME/conf/logback.xml에 넣는다. logback.xml 샘플 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 <?...

October 30, 2015 · 2 min · 페이퍼

Flume 설치 및 테스트 (mac)

Flume 란? 여러대(여러서비스..)에 기록되는 로그파일들을 실시간으로 한곳으로 모아주는 서비스 설치 http://flume.apache.org/download.html 에서 다운로드 한다. 적절한 곳에 압축을 풀어 준다 ~/dev/tool/flume JAVA_HOME이 지정되 있지 않으면. ~/.bash_profile 을 열어 환경 변수를 설정해 준다. 1 export JAVA_HOME = /usr (자바 경로.) 설치 및 테스트는 mac에서 했지만. centos에서도 잘되리라 믿는다. 기본 flume.conf 파일 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 # The configuration file needs to define the sources, # the channels and the sinks....

October 29, 2015 · 3 min · 페이퍼

디지탈오션에 서버 셋팅기 (centos 6.7)

친구랑 개발하는 간단한 쪽지앱의 서버로 사용할 서버를 구축했다. 물론 나는 잘 모른다 모든건 다 구글을 통해.. 1. SWAP 메모리 할당 https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-6 1 2 3 4 5 dd if=/dev/zero of=/swapfile bs=1024 count=2048k mkswap /swapfile swapon /swapfile chown root:root /swapfile chmod 0600 /swapfile 아래 내용을 /etc/fstab 에 붙인다. 1 /swapfile swap swap defaults 0 0 2. 서버 시간을 KST 로 바꿈 & rdate 설치 1 2 ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime yum install rdate 3....

September 15, 2015 · 2 min · 페이퍼

jfreeChart에서 한글 폰트 사용 (centos 폰트 설정)

jfreeChart를 사용하는 중인데 tomcat위에서 돌리면 한글이 ㅁㅁㅁ 과 같이 나온다. /usr/share/fonts 폴더에 폰트파일을 넣고 fc-cache -fv 를 해주자!! 1 2 3 4 5 6 7 8 // 코드 상에 아래와 같이 폰트를 지정한다. private static final Font _BASE_FONT = new Font("나눔고딕",Font.PLAIN,11); ... 중략 ''' // setFont를 적절하게 코드 내에 사용한다. lineAndShapeRenderer.setLegendTextFont(i, _BASE_FONT); ... tomcat 재시작은 필요 없다.

July 1, 2015 · 1 min · 페이퍼

아파치에서 403 오류 나올때.

이것저것 했는데 403이 계속 나오면.. 1 chcon -R --reference=/var/www /www/webroot 또는 1 chcon -R -h -t httpd_sys_content_t /www/webroot

March 27, 2015 · 1 min · 페이퍼

git 관련 명령어 모음

svn to git 마이그레이션 1 2 git svn clone --stdlayout --no-metadata -A users.txt svn://example.com/repository/projectname cd projectname 아래 users.txt 만드는건데 perl 이 없어서 그런지.. 안되네요… ㅠ svn log ^/ --xml | grep -P "^<author" | sort -u | \ perl -pe 's/<author>(.*?)<\/author>/$1 = /' > users.txt ignore file처리 1 git svn show-ignore -i trunk > .gitignore remote git 지정 1 git remote add origin git@git.example.com:group/projectname.git tags 처리 1 git for-each-ref refs/remotes/tags | cut -d / -f 4- | grep -v @ | while read tagname; do git tag "$tagname" "tags/$tagname"; git branch -r -d "tags/$tagname"; done branches 처리 1 git for-each-ref refs/remotes | cut -d / -f 3- | grep -v @ | while read branchname; do git branch "$branchname" "refs/remotes/$branchname"; git branch -r -d "$branchname"; done push한다....

March 4, 2015 · 1 min · 페이퍼

mysql, mariadb에서 유니코드(utf8mb4) 지원하기

1. 현재 설정된 상태 확인 1 2 3 4 5 6 7 8 9 10 11 12 13 MariaDB [(none)]> show variables like "%character%";show variables like "%collation%"; +--------------------------+---------------------------------+ | Variable_name | Value | +--------------------------+---------------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/local/mysql/share/charsets/| +--------------------------+---------------------------------+ 2....

February 10, 2015 · 2 min · 페이퍼

CentOS 명령어 모음

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 #프로그램 설치위치 찾기 which java /usr/bin/java #오래된 로그파일만 찾아서 삭제함 find /logs/httpd/ -type f -mtime +180 -exec rm -f {} \; #hosts 편집 vi /etc/hosts #dns서버 수정 vi /etc/resolv.conf #OS 비트 확인 getconf LONG_BIT #OS 버전 확인 cat /etc/issue #폰트목록 fc-list #폰트 반영 (/usr/share/fonts 에 폰트 넣고) fc-cache -fv #로그보기 tail -f file....

February 5, 2015 · 1 min · 페이퍼