No Image

iptables port redirection

2015-12-29 KENNETH 1

iptables 를 이용한 포트 리다이렉션   원하는 내용 OS : linux 기본 smtp 포트는 25번을 사용하되, 587에서의 접근을 허용하고자 함 다만, 메일엔진에서 설정하지 않고 리눅스의 iptables만을 가지고 처리 하고 싶다면…   설정 echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -p tcp –dport 587 -j REDIRECT –to-port 25 기존에 작동하는 25번 포트는 변동 사항이 없으며 추가로 587 포트에 대해서 접근을 요청시 25포트로 리다이렉션 해줌   테스트 사용툴 : terminal & telnet # telnet 192.168.0.111 587 Trying 192.168.0.111… Connected to 192.168.0.111. Escape character is ‘^]’. 220 office.ilaya.com ESMTP Sendmail 8.14.7/8.14.7; Tue, 29 Dec 2015 11:39:37 +0900

No Image

Recompiling VirtualBox kernel modules [FAILED] on centos7.2 or rhel7.2

2015-12-18 KENNETH 0

Recompiling VirtualBox kernel modules [FAILED] on centos7.2 or rhel7.2   환경 OS : CentOS7 (7.2.1511) VirtualBox : 5.0.10_104061_el7-1 yum-repository 등록후 yum install VirtualBox-5.0 명령을 통한 설치 작업진행 사실 CentOS-7.2업데이트후 정상적인 구동이 되지 않았기 때문에 재설치 까지 진행해 본 것임   설치시 오류 No precompiled module for this kernel found — trying to build one. Messages emitted during module compilation will be logged to /var/log/vbox-install.log. Stopping VirtualBox kernel modules [ OK ] Recompiling VirtualBox kernel modules [FAILED] (Look at /var/log/vbox-install.log to find out what went wrong) Verifying : VirtualBox-5.0-5.0.10_104061_el7-1.x86_64 1/1 Installed: VirtualBox-5.0.x86_64 0:5.0.10_104061_el7-1   로그 내용 로그 내용은 상당히 많지만 대략 이정도가 주목 할 만 한듯 /tmp/vbox.0/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltLinuxPacketHandler’: /tmp/vbox.0/linux/VBoxNetFlt-linux.c:928:9: error: implicit declaration of function ‘vlan_tx_tag_present’ [-Werror=implicit-function-declaration] if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN) ^ /tmp/vbox.0/linux/VBoxNetFlt-linux.c:938:13: error: implicit declaration of function ‘vlan_tx_tag_get’ [-Werror=implicit-function-declaration] pVHdr->h_vlan_TCI = RT_H2N_U16(vlan_tx_tag_get(pBuf)); ^ cc1: some warnings being treated [ more… ]

No Image

centos7(rhel7)에서 fcitx 로 입력기 변경하기

2015-11-03 KENNETH 0

repository 등록 yum install epel-release yum-config-manager –add-repo=https://copr.fedoraproject.org/coprs/mosquito/myrepo/repo/epel-7/mosquito-myrepo-epel-7.repo   fcitx 관련 패키지 설치 yum install fcitx-configtool fcitx-devel 관련 패키지를 설치 한뒤에 는 /etc/yum.repos.d/mosquito-myrepo-epel-7.repo 파일에서 ”enabled=0” 으로 반드시 고쳐주기 바란다..   fcitx-hangul 설치를 위한 패키지 추가 설치 yum install fdupes intltool libhangul-devel   rpmfind.net 에서 다운받아 설치 fcitx-hangul-0.3.0-4.1.3.x86_64.rpm   fcitx-hangul 패키지가 없을경우 한글입력이 정상적으로 되지 않는다. fcitx-hangul-src-rpm  을구해서 빌드하려고 했으나.. 정상적으로 진행되지 않기 때문에 귀챦아서 빌드된 rpm으로 설치를 진행함   .xprofile, .bashrc 등에다가 내용 추가 export XMODIFIERS=”@im=fcitx” export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx   x-window 재시작을 하지 않아도 imsettings-switch fcitx 하니까.. 변경된 입력기가 활성화 되긴 되는것 같더라… 물론 몇번의 시도에 의한 패키지 설치 및 profile 반영이 이미 되어있는 상태여서 그랬더것 같기도 하다만.. 그 부분을 확인하는 것은 더욱 귀찮구나…   PS. 지에디트의 경우 문제없이 사용이 가능했으나. 크롬에서 문제가 발생한다. 한글입력시 문단 마지막 단어가 강제 스페이스처리된다.. 엄청나게 빨리치면 괜찮은듯.. ”조금만 늦어져 도문제가되는듯…. ” <——- 이렇게…  

How to get exit code in bash

2015-10-12 KENNETH 0

bash에서 exit code (exit value) 반환받기 형식 : 명령어;echo $? # ls;echo $? 0 # ls aaaa;echo $? ls: cannot access aaaa: No such file or directory 2 이와같이 명령어가 정상적으로 수행 되었을 경우 ”0”을 그렇지 않은 경우 ”0이 아닌 다른 코드”를 반환하게 된다. ”$?” 변수는 명령어가 실행된 다음 종료상태(exit code, exit status)를 알려주기 때문에 어떤 명령어를 실행한 다음, 결과를 확인할 때 사용하면 되겠다.   다음은 쉘 스크립트의 내장 변수 및 exit code 안내이므로 참고하면 좋겠다. 출처 : http://www.ischo.net/board_linux/5188   shell 내장변수 $$ : 해당 프로세스의 PID값 $? : 가장 최근에 실행한 명령의 종료값 $# : 프로그램에 전달된 인수의 개수 $0 : 명령수행시 명령의 이름을 기억하는 변수값 $n : 전달된 n번째 인수(ex:$1,$2) $* : 전달된 인수들 전체를 하나의 문자열로 표시함 $@ : 전달된 인수들 전체를 문자열의 목록으로 표시함 $! : 마지막으로 실행된 백그라운드 프로세스 pid값 Shell exit code ( 내장변수 $? [ more… ]

No Image

SSL Library Error: -8181 Certificate has expired

2015-09-08 KENNETH 0

아파치(apache)가 구동되지 않는 문제!!! 에러내용 [error] SSL Library Error: -8181 Certificate has expired [error] Unable to verify certificate ‘Server-Cert’. Add “NSSEnforceValidCerts off” to nss.conf so the server can start until the problem can be resolved. [error] Certificate not verified: ‘Server-Cert’   2. 환경 OS : RHEL-5, CentOS-5 패키지 : 기본 rpm 기반의 apache 와 mod_nss 다른 버전은 테스트 안해봄 https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=711085 이런 내용이 있다고들 한다.   mod_nss 패키지를 설치하면서 생성되는 인증서의 만료기간이 작업일자를 기준으로 4년후이기 때문에.. 이것을 설치해놓고 4년동안 문제가 없다가, 만료되면 에러와 함께 아파치가 구동되지 않는 문제가 발생한다. certutil -d /etc/httpd/alias -L -n Server-Cert 명령어를 이용해서 확인해 보도록 하자   3. 해결법 설정변경 파일 : /etc/httpd/conf.d/nss.conf 설정변경 : NSSEnforceValidCerts off   (없을시 추가해줌)   재생성 cd /etc/httpd/alias rm -f cert8.db key3.db secmod.db /usr/sbin/gencert /etc/httpd/alias   mod_nss 재설치 mod_nss 를 재설치 하면 위에서 설명한 ”재생성” 작업이 수반된다. yum remove mod_nss yum install mod_nss   가장 괜찮은 [ more… ]