본문 바로가기

반응형

리눅스

date 명령어 date 명령어date 명령어는 리눅스 및 UNIX 기반 시스템에서 현재 날짜와 시간을 표시하거나 설정하는데 사용되는 명령어입니다.기본 구문date [옵션] [날짜 및 시간 형식]주요 옵션-d, --date: 지정한 날짜 및 시간을 표시.-s, --set: 시스템 시계를 설정 (슈퍼유저 권한 필요).-u, --utc, --universal: UTC (협정 세계시)로 시간 표시.-R, --rfc-2822: RFC 2822 형식으로 시간 표시.+: 날짜 및 시간 형식을 지정하는 데 사용.사용 예시데이터 포맷echo $(date '+%Y-%m-%d %H:%M:%S')$ echo $(date '+%Y-%m-%d %H:%M:%S')2020-12-28 21:20:38현재 날짜 및 시간 표시date$ date2020.. 더보기
아파치(Apache) 웹 서버에서 서버 정보 페이지를 설정하는 방법 아파치(Apache) 웹 서버에서 서버 정보 페이지를 설정하는 방법 Apache 웹 서버에서 서버 정보 페이지를 설정하려면 mod_status 모듈을 사용해야 합니다. mod_status 모듈은 Apache의 현재 실행 상태에 대한 정보를 제공합니다. 1. mod_status 모듈 활성화 vim /etc/httpd/conf.modules.d/00-base.conf LoadModule status_module modules/mod_status.so 2-1. mod_status 옵션 설정 mod_status 모듈의 옵션을 설정해야 합니다. Apache의 전역 설정 파일(httpd.conf)에서 수정합니다. vim /etc/httpd/conf/httpd.conf # Supplemental configurati.. 더보기
아파치 웹 서버에서 IP로 접속을 차단하는 방법 아파치 웹 서버에서 IP로 접속을 차단하는 방법아파치에서 IP로 접속을 차단하는 몇 가지 방법입니다.1 .htaccess 파일을 사용하여 IP 차단웹 서버의 루트 디렉토리 또는 해당 디렉토리에 .htaccess 파일을 생성합니다.다음과 같은 내용을 .htaccess 파일에 추가하여 특정 IP 주소 또는 IP 대역을 차단합니다.order allow,denydeny from 192.168.0.1deny from 10.0.0.0/24allow from all2 httpd.conf 또는 apache2.conf 파일을 사용하여 IP 차단웹 서버의 httpd.conf 또는 apache2.conf 파일을 엽니다.다음과 같은 내용을 파일에 추가하여 특정 IP 주소 또는 IP 대역을 차단합니다. Order allo.. 더보기
아파치 디폴트 페이지(apache default page) 편집 아파치 디폴트 페이지(apache default page) 편집아파치 패키지 설치dnf install -y httpd아파치 버전 정보$ httpd -vServer version: Apache/2.4.37 (centos)Server built: Sep 15 2020 15:41:16welcome(welcome.conf) 페이지 편집vim /etc/httpd/conf.d/welcome.conf Options -Indexes #ErrorDocument 403 /noindex/index.html ErrorDocument 403 http://www.sangchul.kr/40x.htmlAlias /noindex /usr/share/httpd/noindex Options MultiViews Director.. 더보기
CentOS 7에서 SELinux를 비활성화하는 방법(selinux disabled) CentOS 7에서 SELinux를 비활성화하는 방법(selinux disabled)SELinux는 CentOS의 기본 보안 기능 중 하나입니다. 하지만 때로는 특정 애플리케이션이나 설정에서 SELinux를 비활성화해야 할 때도 있습니다. 이를 위해 다음과 같은 단계를 따를 수 있습니다.1. SELinux 상태 확인현재 SELinux의 상태를 확인합니다.sestatus위 명령을 실행하면 현재 SELinux 상태가 enforcing, permissive, disabled 중 하나로 나타납니다.enforcing : SELinux가 활성화되어 있고 보안 정책을 강제로 적용합니다.permissive : SELinux가 활성화되어 있지만 보안 정책을 적용하지 않습니다. 대신 정책 위반에 대한 경고 메시지가 로그에.. 더보기
ntpstat 명령어 ntpstat 명령어ntpstat는 NTP(Network Time Protocol) 동기화 상태를 간단히 확인할 수 있는 유용한 명령어입니다. 주로 NTP 서버 또는 클라이언트의 동기화 여부, 시간 오차 등을 빠르게 점검할 때 사용됩니다.ntpstat 설치dnf install -y ntpstatntpstat --versionntpstat 실행ntpstat성공적인 동기화 상태synchronised to NTP server (203.248.240.140) at stratum 4 time correct to within 22 ms polling server every 1024 ssynchronised to NTP server : 특정 NTP 서버(203.248.240.140)와 동기화됨.stratum .. 더보기
[명령어] which, whereis, locate 명령어 which, whereis, locate 명령어 - 명령어 위치을 찾는 명령어 which 명령어 : 명령의 전체 경로를 보여준다 $ which ls alias ls='ls --color=auto' /usr/bin/ls $ which ifconfig /usr/sbin/ifconfig whereis 명령어 : 명령의 실행파일, 소스, 매뉴얼 페이지가 어디 있는지 보여준다. $ whereis ls ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz $ whereis ifconfig ifconfig: /usr/sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz ###실행 파일만 찾는다 $ where.. 더보기
[리눅스] CentOS7에서 시스템 메시지 로그 필터링 CentOS7에서 시스템 메시지 로그 필터링 Environment $ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) Issue /var/log/messages tail -f /var/log/messages $ tail -f /var/log/messages Dec 18 12:15:01 bvm-24 systemd: Started Session 6988 of user root. Dec 18 12:20:01 bvm-24 systemd: Started Session 6989 of user root. Dec 18 12:25:01 bvm-24 systemd: Started Session 6990 of user root. Dec 18 12:25:40 bvm.. 더보기

728x90
반응형