본문 바로가기

728x90

리눅스

웹 서버에서 HSTS(HTTP Strict Transport Security)를 설정하는 방법 웹 서버에서 HSTS(HTTP Strict Transport Security)를 설정하는 방법 HSTS(Strict Transport Security)는 웹 사이트의 보안을 강화하기 위한 메커니즘 중 하나로, HTTPS를 통해 통신하는 것을 강제하고 중간자 공격을 방지하는 기능을 제공합니다. HSTS를 설정함으로써 클라이언트(웹 브라우저)는 지정된 기간 동안 해당 웹 사이트와의 모든 통신을 HTTPS를 통해서만 수행하도록 강제됩니다. Redirect HTTP connections to HTTPS Apache 설정 ServerName example.com RewriteEngine on RewriteCond %{HTTPS} !on RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [.. 더보기
ubuntu 22.04에 redis를 설치하는 방법 ubuntu 22.04에 redis를 설치하는 방법 테스트 환경 $ lsb_release -d Description: Ubuntu 22.04 LTS redis 설치 redis repository 추가 curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list 로컬 apt.. 더보기
Ubuntu에 Node.js와 npm을 설치하는 방법 Ubuntu에 Node.js와 npm을 설치하는 방법은 테스트 환경 $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS" 1. Node.js 설치(Node.js 공식 패키지 추가) Ubuntu 리포지토리에 있는 Node.js 패키지를 사용하여 설치할 수 있지만, 일반적으로는 Node.js 공식 버전을 설치하는 것이 좋습니다. curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/nodesource.. 더보기
apt(dpkg) error apt(dpkg) error - 패키지들간의 의존성 문제 테스트 환경 $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS" apt(dpkg) error $ apt install nodejs ... Errors were encountered while processing: mysql-server-8.0 needrestart is being skipped since dpkg has failed E: Sub-process /usr/bin/dpkg returned an error code (1) apt(dpkg) error 해결 방법 cd .. 더보기
Ubunut에서 MySQL 8을 바이너리 파일로 설치하는 방법 Ubunut에서 MySQL 8을 바이너리 파일로 설치하는 방법 테스트 환경 $ lsb_release -d Description:Ubuntu 22.04.1 LTS MySQL 설치 MySQL 바이너리 파일 다운로드 ☞ MySQL Community Downloads - https://dev.mysql.com/downloads/mysql 1. MySQL 계정 생성 ** ubuntu sudo 그룹에서 group id 27번을 사용하고 있음. 더보기 Ubuntu 패키지 매니저를 사용하여 MySQL을 설치할 때, mysql 계정 정보 $ cat /etc/passwd | grep mysql mysql:x:118:121:MySQL Server,,,:/nonexistent:/bin/false $ cat /etc/group.. 더보기
GNU C 라이브러리(glibc)의 버전을 확인하는 방법 GNU C 라이브러리(glibc)의 버전을 확인하는 방법 우분투 운영체제의 버전 정보 확인 lsb_release -d $ lsb_release -d Description:Ubuntu 22.04.2 LTS 명령어로 확인 ldd 명령어를 사용하여 동적 링크 라이브러리를 조회하고 glibc의 버전 정보를 확인할 수 있습니다. ldd --version $ ldd --version ldd (Ubuntu GLIBC 2.35-0ubuntu3) 2.35 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MER.. 더보기
CentOS 7에서 MySQL 8을 바이너리 파일로 설치하는 방법 CentOS 7에서 MySQL 8을 바이너리 파일(tar 아카이브)로 설치하는 방법 테스트 환경 $ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) MySQL 설치 MySQL 바이너리 파일 다운로드 ☞ MySQL Community Downloads - https://dev.mysql.com/downloads/mysql 1. MySQL 계정 생성 groupadd -g 27 mysql useradd -m -c "MySQL Server" -d /usr/local/mysql -s /bin/false -u 27 -g 27 mysql 생성된 mysql 계정 확인 cat /etc/passwd | grep mysql $ cat /etc/passwd | gre.. 더보기
Rocky Linux 9에서 Postfix 메일 서버를 설치하고 설정하는 방법 Rocky Linux 9에서 Postfix 메일 서버를 설치하고 설정하는 방법 테스트 환경 $ cat /etc/redhat-release Rocky Linux release 9.1 (Blue Onyx) 1. Postfix 설치 hostnamectl 명령어로 호스트 이름 설정 hostnamectl set-hostname pmail.sangchul.kr /etc/hosts 파일 편집하여 호스트 이름 설정 sudo vim /etc/hosts 192.168.0.52pmail.sangchul.kr Postfix 패키지 설치 dnf install -y postfix 설치 중에 Postfix의 기본 설정 대화식 대화창이 나타납니다. 기본 설정을 사용하려면 "OK"를 선택하고 진행합니다. Postfix 버전 정보 po.. 더보기

728x90