본문 바로가기

서버다스리기

CORS 테스트 방법 원본 출처 : https://medium.com/pareture/simple-local-cors-test-tool-544f108311c5 Simple Local CORS test tool Quickly checking out CORS issues medium.com CORS 란? https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS Cross-Origin Resource Sharing (CORS) - HTTP | MDN Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or .. 더보기
디렉터리 구조만 복사하기 만약 디렉터리 구조만 복사하려면 어떻게 해야할까? 디렉터리 통째로 복사한 다음 파일만 삭제한다? 이건 너무 무식한 방법이다. 시간도 많이 걸린다. 용량이 몇기가 된다면 어떻게 할 것인가? 우리는 다음과 같은 쉘명령을 이용해서 간단하게 처리할 수 있다. ㅎㅎ cd new_dir (cd old_dir; find . -type d ! -name "." ) | xargs mkdir 물론 퍼미션은 다시 지정해 줘야 한다. 더보기
Qmail Queuelifetime 설정 출처: http://www.cacti.kr/tc/119 [원문] How often does qmail retry to send email? Each message has its own retry schedule. The longer a message remains undeliverable, the less frequently qmail tries to send it. The retry schedule is not configurable. The following table shows the retry schedule for a message that's undeliverable to a remote recipient until it bounces. Local messages use a similar, b.. 더보기
Apache / Nginx / Lighttpd 에서 SSL 보안서버인증서 설정하기 웹서비스를 위해 가장 많이 사용하는 Apache, Nginx, Lighttpd (요즘은 많이 쓰지 않죠 ^^;;) 의 경우각각 SSL 보안서버인증서를 어떻게 설정하는지 간략하게 적어보았습니다. 1. Apache 아래와 같이 설정하고 Apache 데몬을 재시작 합니다. NameVirtualHost *:443 ServerName www.domain.com DocumentRoot /var/www/site1 SSLEngine on SSLCertificateFile /path/to/www_domain_com.crt SSLCertificateKeyFile /path/to/www_domain_com.key SSLCertificateChainFile /path/to/rootCA.crt ServerName www.dom.. 더보기
grep 활용 흔히 grep은 어떤 파일에 포함된 문자열을 검색할 때 많이 사용한다. 검색어로는 단순한 단어를 사용하기도 하고 정규식을 이용하기도 한다. [사용법] grep -B 윗라인 -A 아랫라인 검색어 파일명 -B : before line -A : after line [사용예] grep -B2 -A2 'test' test.txt => test.txt 파일에서 test 에 매치되는 라인을 기준으로 상위 2라인, 하위 2라인을 함께 출력 더보기
서버 설정시 Swap은 얼마나.. 출처 : https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007 Redhat 자료에 따르면 RAM이 8G~64GB 사이일 경우 swap은 메모리의 절반정도면 적당하다고 함.예를 들어 RAM이 16G 이면 swap 은 8G 정도로 설정하면 된다는 얘기.Memory와 Disk 는 엄청난 속도차이가 나므로 swap을 사용할 정도가 되면 Memory 를 늘려주거나 load balancing 을 생각하는 게 나을 수도 있지만 일시적으로 써야 할 때를 위해 어느 정도 크기는 잡아줘야 함.Table 16.2. Recomm.. 더보기
cacti-spine 설치와 설정 소스다운로드 : cacti-spine-0.8.7a.tar.gz 사이트에서 직접 다운로드 : http://www.cacti.net/downloads/spine/cacti-spine-0.8.7a.tar.gz 아래 순서대로 진행하면 설치가 된다고 한다. 안타깝게도 필자는 7번 make 과정에서 에러가 나서 진행할 수 없었다. ㅡㅡ; shell>aclocal shell>libtoolize --force (glibtoolize --force on Max OS) shell>autoheader shell>autoconf shell>automake shell>./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc shell>make shell>make .. 더보기
Cacti 설치와 설정 출처 : http://www.cacti.net/downloads/docs/html/index.html 이 문서는 Cacti 공식사이트에 있는 install 문서를 나름대로 번역, 수정한 문서입니다. 부록 : cacti-spine 설치와 설정 설치전 필요한 패키지 httpd php php-mysql php-snmp mysql mysql-server net-snmp 설치 및 설정 소스파일의 압축을 푼다. shell> tar xzvf cacti-version.tar.gz MySQL DB를 생성한다. shell> mysqladmin --user=root create cacti 기본 cacti 테이블을 생성한다. shell> mysql -u root {cacti정보를 저장할 DB명} -p < cacti.sql 예.. 더보기
Apache2와PHP 설치 및 설정 Apache2 와 PHP 설치 및 설정 : 몽땅 yum을 이용하여 설치함 (귀차니즘의 압박 OTL) Apache2 설치 yum install httpd httpd-devel PHP설치 yum install php php-devel php-gd php-common php-xml php-pear php-mysql php-mbstring 이 글은 스프링노트에서 작성되었습니다.이 글은 스프링노트에서 작성되었습니다. 더보기
쉘변수변경 쉘스크립트에서 변수값을 직접 변경함 예) #!/bin/bash TEST="test02" TEST2=${TEST/test/TEST} echo $TEST2 설명 : test -> TEST로 변경 [ 문법 ] ${변수명/이전단어/새단어} 이 글은 스프링노트에서 작성되었습니다. 더보기