아래와 같은 시스템로그가 계속 발생하는 것은 문제 없는, Info성 메시지이다. 하지만 이 부분이 거슬릴 경우 해당 메시지가 쌓이지 않도록 설정할 수 있다.

 

1. 아래 커맨드 입력을 통해 해당 로그가 쌓이지 않도록 설정해주자.

echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >> /etc/rsyslog.d/ignore-systemd-session-slice.conf

 ( 한줄이다. )

 

2. 설정파일 적용을 위해 rsyslog 재시작을 해주자.

systemctl restart rsyslog

 

출처 : https://growingsaja.tistory.com/217

RockyLinux8 이상에서 부팅시 생성되는 /var/log/dmesg 파일이 존재하지 않는 현상이 있었다.
이를 해결하기 위해 아래 방법을 수행하면 된다.

1) vi /etc/systemd/system/dmesg.service 파일에 아래 내용 추가  (해당 파일은 없으니 만들어야 함)

 [Unit]
 Description=Create /var/log/dmesg on boot
 ConditionPathExists=/var/log/dmesg

 [Service]
 ExecStart=/usr/bin/dmesg
 StandardOutput=file:/var/log/dmesg

 [Install]
 WantedBy=multi-user.target

2) /var/log/dmesg 파일 생성 및 SeLinux 컨텍스트 확인 (Selinux가 비활성화 상태면 dmesg파일만 만들면 된다.)

 # touch /var/log/dmesg
 # restorecon -v /var/log/dmesg (selinux 비활성화면 이 라인은 스킵)

3) 부팅 시 서비스가 시작되도록 활성화

 # systemctl enable dmesg

4) 시스템 재시작 (재부팅 후 /var/log/dmesg 파일 생성 및 파일 내용 확인 할 것)

 #shutdown -r now


참조 : https://www.getpagespeed.com/solutions/the-var-log-dmesg-file-is-not-created-during-boot-for-rocky-linux-8

CentOS docker 이미지를 컨테이너로 생성해서 Node.js를 설치했다.
Node.js를 설치하면 npm도 같이 설치된다.
(npm : Node Package Manager로 기본 패키지 관리자)

1. yum update하기

yum -y update
(최고권한으로 설치할 경우, sudo yum -y update)

2. NodeSource(회사)는 효율적인 노드 서비스를 제공하고 리눅스용 Node.js저장소가 있는지 확인한다.
CentOs서버에서 NodeSource저장소를 사용해 Node.js와 npm을 설치하는데 도움이 된다.

setup_12.x는 12버전을 설치할 경우이다. 
예를들어 8, 10버전이 필요할 경우에는 setup_8.x 혹은 setup_10.x로 넣고 명령어를 실행하면 된다!

curl -sL https://rpm.nodesource.com/setup_12.x | bash -
(최고권한으로 설치할 경우, curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - )

3. Node.js 설치하기

yum install -y nodejs

4. 설치 확인하기
node와 npm버전 확인 하는 명령어이다.
설치가 잘 됬다면 버전이 나온다!

node -v
npm -v 

 

출처 : https://jin2rang.tistory.com/entry/CentOS7-Nodejs-%EC%84%A4%EC%B9%98

출처: https://wnw1005.tistory.com/628 [씨실과 날실 - IT:티스토리]

카카오 미러

http://mirror.kakao.com/

여타의 국내 미러들에 비해 속도가 굉장히 빠르고 서버 안정성 또한 높은 편

 

네이버 미러

https://mirror.navercorp.com/

네이버 클라우드다 록키 리눅스의 주요 파트너로 참가

 

카이스트 미러 - KAIST 파일 서비스(SPARCS)

https://ftp.kaist.ac.kr/

국내의 가장 대표적인 미러 사이트.

 

라넷 미러 - 사랑천사 네트워크 FTP 서비스 - LANET

https://ftp.lanet.kr/

 

아니길 미러 - AniGil Linux Archive

https://mirror.anigil.com/

임시우님의 개인 미러

 

용복 미러 - Yongbok.net

https://mirror.yongbok.net/

시스템 엔지니어 김용복님이 운영하는 개인 미러

 

하루카상(Harukasan) 미러

https://ftp.harukasan.org/

부경대에서 지원하는, 동아시아 국가를 위한 미러

 

premi.st 미러 - mirror.premi.st

https://mirror.premi.st/

이민구님이 운영하는 개인 미러

 

검은 개(흑구) 미러 - Heigou's Private Mirror

https://mirror.heigou.pe.kr/

Heigou님이 운영하는 개인 미러

과거 Maakpain's Linux Mirror라는 이름이었으나 도메인을 변경하게 되어 공식 미러 명칭도 바꿈

기존의 도메인은 올해 말까지만 유지하게 됨.

미사카 미러 - 미코토 네트워크(Misaka Mikoto Network) 미러

https://mirror.misakamikoto.network/

Misaka님이 운영하는 개인 미러

한국 FreeBSD 사용자 그룹 미러

https://ftp.kr.freebsd.org/pub/

FreeBSD 전문 미러지만 리눅스로는 유일하게 안녕 리눅스가 미러링되고 있음.

IMAP 설치

[root@www /tmp]# mv imap-2000b /usr/local/imap
[root@www /tmp]# cd /usr/local/imap
[root@www /imap]# make slx imap을 컴파일 한다

 

변경사항 : 
원문 글에서는 imap-2000b 버전이지만 나의 경우 imap-2007f 버전을 사용하였음. 

imap-2007f.tar.gz
1.90MB


변경사항 : 컴파일 옵션을 make slx SSLTYPE=unix 로 해야 php에서 imap 연동 테스트 시

PHP Notice:  Unknown: Server disables LOGIN, no recognized SASL authenticator (errflg=2) in Unknown on line 0

와 같은 에러가 발생하지 않음.

컴파일이 완료되면 imapd 디렉토리에 imapd가 ipopd디렉토리에는 ipop2d, ipop3d가 생성되며,
ipop2d는 잘 쓰지 않으므로 복사하지 않아도 됩니다.

=================================================================================
% 오류 발생시
낮은 Imap 버전을 최신버전의 리눅스 OS 에 설치시 Openssl 경로가 맞지 않아
아래와 같이 오류가 발생할수 있습니다.

osdep.c:231:20: error: x509v3.h: No such file or directory
osdep.c:232:17: error: ssl.h: No such file or directory
osdep.c:234:17: error: pem.h: No such file or directory
osdep.c:235:20: error: buffer.h: No such file or directory
osdep.c:236:17: error: bio.h: No such file or directory
osdep.c:237:20: error: crypto.h: No such file or directory
osdep.c:238:18: error: rand.h: No such file or directory
.
.
.

등등..

그럴경우 오류나는 부분의 윗줄을 잘 살펴보면 이와 같이 소스파일에 설정된 SSL 경로를 확인할 수 있습니다.

echo -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -DSSL_CERT_DIRECTORY=\"/usr/local/ssl/certs\" -DSSL_KEY_DIRECTORY=\"/usr/local/ssl/certs\" >> OSCFLAGS

간단하게 해당 경로로 심볼릭 링크를 생성해주면,,

ln -s /usr/include/openssl/ /usr/local/ssl/include/openssl

이후 설치하면 오류 없이 설치 가능합니다.
==================================================================================

[root@www imap]# cp imapd/imapd /usr/sbin 생성된 실행파일들을 복사합니다.
[root@www imap]# cp ipopd/ipop3d /usr/sbin

이들은 xinetd 슈퍼데몬에 의해서 실행되므로 클라이언트 쪽에서 접속하여 사용할 수 있도록 하려면 환경설정을 수정해 주어야 합니다.
※ 배포판 레드햇6.2이하에서는 inetd 슈퍼데몬에 의해 실행되므로 환경설정이 조금 다릅니다.

[root@www imap]# cd /etc/xinetd.d
[root@www xinetd.d]# vi imapd   imapd 실행을 위한 환경설정파일을 생성합니다.

 

service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += DURATION USERID
log_on_failure += USERID
}

[root@www xinetd.d]# vi ipop3d

service pop3
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/ipop3d
log_on_success += USERID
log_on_failure += USERID
}

[root@www xinetd.d]# vim /etc/services
......
pop3 110/tcp pop-3 # POP version 3
pop3 110/udp pop-3
......
imap2 143/tcp imap # Interim Mail Access Proto v2
imap2 143/udp imap
......

[root@www xinetd.d]# /etc/rc.d/init.d/xinetd restart  슈퍼데몬을 재가동합니다.

Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]

telnet을 이용하여 로컬호스트 110포트(pop3)로 접속하여 테스트합니다.

[root@www xinetd.d]# telnet localhost 110

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK POP3 localhost.localdomain v2000.70 server ready
user pyd0927
+OK User name accepted, password please
pass 123123
+OK Mailbox open, 0 messages
quit
+OK Sayonara
Connection closed by foreign host.

IMAP은 기본적으로 143 포트를 사용합니다.

출처 : https://soul.tistory.com/4

리눅스에서 디스크 용량을 확인할 때 df 명령어로 확인했을 때 용량이 컸는데 du 명령어로 확인하니까 용량이 작았다.
파일을 삭제했는데 df에 반영이 되지 않은 것이다.

예를 들어, /var 용량의 경우
df 명령어로 확인했을 때 사용중인 공간이 31G 였다고 하면
du 명령어로 확인해보니 사용중인 공간이 10G 밖에 되지 않는다.

이 문제가 발생하는 이유는
보통 시스템을 오래 켜 둔 상태에서 발생한다고 한다.
그 이유는 특정 프로세스가 file descriptor 를 연 후에 file descriptor 가 가리키는 파일을 지웠는데
그 프로세스가 여전히 파일을 읽고 쓰고 있는 것이다.

따라서 lsof 명령어를 통해 문제가 있는 프로세스를 찾을 수 있다.
우선, 문제가 있는 디렉토리의 열린 파일 목록을 검색한다.

# lsof

또는 해당 디렉토리 검색

# lsof [DIRECTORY]

grep 명령어로 deleted 만 검색

# lsof | grep deleted

lsof 명령어를 통해 확인해보면 NAME 마지막에 (deleted) 라고 되어있는 프로세스를 확인할 수 있다.

이 경우에는 파일을 지웠지만 아직까지 남아있어 용량을 차지하고 있는 프로세스다.
따라서 해당 프로세스의 PID를 kill 명령어를 통해 죽이면 된다.

# kill -9 [PID]

그리고 다시 확인해보면 정상으로 돌아와있는 것을 확인할 수 있다.

df 명령어의 경우 특정 상황에서 정확한 실제 용량을 반영해주지 못하는 경우가 발생한다.
따라서 lsof 명령어를 통해 문제 있는 프로세스를 찾아 죽이는 방법을 통해 정상적으로 돌아오게 할 수 있지만
시스템 재시작이 가능하다면 재시작하는 것도 하나의 방법이 될 수 있다.

[참고 사이트]

df 용량이 실제하고 안 맞을 때

출처 : https://jaynamm.tistory.com/entry/%EB%A6%AC%EB%88%85%EC%8A%A4%EC%97%90%EC%84%9C-df-%EC%9A%A9%EB%9F%89%EA%B3%BC-du-%EC%9A%A9%EB%9F%89%EC%9D%B4-%EB%8B%A4%EB%A5%BC-%EA%B2%BD%EC%9A%B0-%ED%99%95%EC%9D%B8

Centos7 브릿지 방화벽(iptables forward) 작동안할시

Centos7 서버에 bridge 를 이용하여 iptables 방화벽을 구성

iptables  forward가 작동하지 않고 nf_contrack 에 패킷이 보이지 않는다

Centos7 에서 아래 모듈을 올려줘야 작동한다

modprobe br_netfilter

Centos6 에서는 아래 파라미터를 1로 활성화 하면 됨

/etc/sysctl.conf
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-arptables = 1

출처 : http://blog.servis.co.kr/index.php/2021/11/17/centos7-bridge_iptables/

gcc 에서 pkg-config 사용법 :

http://tjcplpllog.blogspot.kr/2014/08/pkg-config.html

================================================================================================

source 로 설치한 패키지의 pkg-config 정보가 인식이 안될때 아래에 사이트에 잘 정리가 되어있다.

 

http://blog.daum.net/heyjun/15705389

 

================================================================================================

 

pkg-config 의 모든 위치를 알고싶다면

locate pkgconfig

 

pkg-config 를 등록하려면

export PKG_CONFIG_PATH=/home/me/usr/libxml/lib/pkgconfig

 

제대로 설정되었는지 확인하려면

echo $PKG_CONFIG_PATH

 

pkg-config 환경변수를 매번 쳐주기 귀찮다면

~/.bashrc를 에디트 해서 export (무지무지 긴 변수)를 적어주면 된다.

 

[출처] http://s2paper.egloos.com/6212047

참조: OpenSSH Legacy Options

OpenSSH 7.0 이상에서 ssh를 사용해서 원격에 접속을 하려할 때 몇 몇 알고리듬은 보안상의 이유로 기본적으로 비활성화 되어 있다. 

NAS와 무선 인터넷 공유기의 ssh를 접속을 하려 하는데 아래와 같이 에러가 나면서 원격 접속이 되질 않는다. -o 옵션을 줘서 알고리듬을 추가 해도 된다. 또는 ~/.ssh/config에 host 정보를 추가 해주면 자동으로 적용이 된다.

no matching host key type found. Their offer: ssh-dss

My Cloud NAS 접속시 문제

krazyeom@MBP:~$ ssh root@192.168.219.18
Unable to negotiate with 192.168.219.18 port 22: no matching host key type found. Their offer: ssh-dss

ssh -oHostKeyAlgorithms=+ssh-dss root@192.168.219.18

~/.ssh/config

Host 192.168.219.18
HosKeyAlgorithms +ssh-dss

 

no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

ASUS 무선 공유기 접속 문제

krazyeom@MBP:~$ ssh admin@192.168.219.5
Unable to negotiate with 192.168.219.5 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 admin@192.168.219.5

~/.ssh/config

Host 192.168.219.5
KexAlgorithms +diffie-hellman-group1-sha1



출처: https://www.appilogue.kr/2844690?utm_source=weirdmeetup&utm_medium=original_link_on_post&utm_campaign=ssh+접속시+no+matching+key+문제+해결 [krazyeom's epilogue]

1. firewalld 중지 및 해제하기

systemctl stop firewalld
systemctl mask firewalld

systemctl status firewalld (firewalld 상태 확인)

* firewalld.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

위와 같이 나오면 정상적으로 죽은 것이다.

2. iptables service 설치

yum -y install iptables-services
systemctl enable iptables
systemctl start iptables

systemctl status iptables (iptables 데몬 상태 확인)

* iptables.service - IPv4 firewall with iptables
   Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled; vendor preset: disabled)
   Active: active (exited) since 수 2021-02-03 05:14:07 KST; 1h 26min ago
 Main PID: 9989 (code=exited, status=0/SUCCESS)

 2월 03 05:14:07 localhost.localdomain systemd[1]: Starting IPv4 firewall with iptables...
 2월 03 05:14:07 localhost.localdomain iptables.init[9989]: iptables: Applying firewall rules: [  OK  ]
 2월 03 05:14:07 localhost.localdomain systemd[1]: Started IPv4 firewall with iptables.

위와 같이 나오면 정상적으로 시작 된 것이다.